Exception in thread "main" com.couchbase.client.vbucket.ConfigurationException: Configuration for bucket "beer-sample" was not found in server list ([http://localhost:8091/pools/default/buckets])


#1

Hi

I am learning the couchbase but while using couchbase-client of version 1.4.12 I am getting below exceptions
with my java code.

List nodes;
try {
nodes = Arrays.asList(new URI(“http://localhost:8091/pools/default/buckets”));
CouchbaseClient client = new CouchbaseClient(nodes, “beer-sample”, " ");
Gson gson = new Gson();
Rant rant = new Rant(UUID.randomUUID(),“Arshan”,“It’s name dude”,“rant”);
Boolean success = client.set(rant.getId().toString(), gson.toJson(rant)).get();
System.out.println(success.booleanValue());
} catch (InterruptedException | ExecutionException | URISyntaxException | IOException e) {

		e.printStackTrace();
	}

can any body help me in resolving this.

Exception in thread “main” com.couchbase.client.vbucket.ConfigurationException: Configuration for bucket “beer-sample” was not found in server list ([http://localhost:8091/pools/default/buckets]).
at com.couchbase.client.vbucket.ConfigurationProviderHTTP.readPools(ConfigurationProviderHTTP.java:274)
at com.couchbase.client.vbucket.ConfigurationProviderHTTP.getBucketConfiguration(ConfigurationProviderHTTP.java:146)
at com.couchbase.client.CouchbaseConnectionFactory.getVBucketConfig(CouchbaseConnectionFactory.java:293)
at com.couchbase.client.CouchbaseClient.(CouchbaseClient.java:248)
at com.couchbase.client.CouchbaseClient.(CouchbaseClient.java:184)
at com.arshan.couchbase.client.ArshanCouchBaseClient.main(ArshanCouchBaseClient.java:26)


dependencies used in maven are :

	<dependency>
		<groupId>com.couchbase.client</groupId>
		<artifactId>couchbase-client</artifactId>
		<version>1.4.12</version>
	</dependency>


	<dependency>
		<groupId>com.couchbase.client</groupId>
		<artifactId>java-client</artifactId>
		<version>2.3.6</version>
	</dependency>

#2

Hi @mas222r,

Did you setup the “beer-sample” bucket? The error message looks like it can’t find the bucket. If you haven’t created the beer-sample bucket, just to go Couchbase console (something like http://localhost:8091), then Settings, then Sample Buckets. I hope that helps.

Also, if you have future questions involving Java, you may want to ask them in the Java forum: https://forums.couchbase.com/c/java-sdk