Skip to content

Getting design documents fails when couchbase is running on docker #1

Description

@ricardojoaoreis

Hello,

Running the BucketManager.getDesignDocuments() fails with an InvocationTargetException

The message is java.lang.RuntimeException: java.net.ConnectException: Connection refused: localhost/127.0.0.1:8091

It seems that the client is still trying to connect to port 8091 somewhere...

I've tried with client versions 2.2.8 and 2.3.6

Here's a JUnit test demonstrating the problem:

package com.couchbase;

import com.couchbase.client.java.Bucket;
import com.couchbase.client.java.CouchbaseCluster;
import com.couchbase.client.java.view.DesignDocument;
import org.junit.Assert;
import org.junit.ClassRule;
import org.junit.Test;

import java.util.List;

public class CouchbaseDesignDocumentsTest {

    @ClassRule
    public static CouchbaseContainer couchbase = new CouchbaseContainer()
        .withBeerSample(true)
        .withFTS(true)
        .withIndex(true)
        .withQuery(true)
        .withKeyValue(true)
        .withClusterUsername("Administrator")
        .withClusterPassword("password");

    @Test
    public void testDesignDocuments() throws Exception {
        CouchbaseCluster cc = couchbase.geCouchbaseCluster();
        Bucket bucket = cc.openBucket("beer-sample");
        List<DesignDocument> designDocuments = bucket.bucketManager().getDesignDocuments();
        Assert.assertNotNull(designDocuments);
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions