Question


I'm all new in couchbase, I copy/paste the first code example in (http://www.couchbase.com/communities/java/getting-started) in my Eclipse project but when I run it and check back the server i can't find the document, below is console output:

2014-03-16 17:30:42.390 INFO com.couchbase.client.CouchbaseConnection: Added {QA sa=/127.0.0.1:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2014-03-16 17:30:42.390 INFO com.couchbase.client.CouchbaseClient: CouchbaseConnectionFactory{, bucket='trust', nodes=[http://localhost:8091/pools], order=RANDOM, opTimeout=2500, opQueue=16384, opQueueBlockTime=10000, obsPollInt=10, obsPollMax=500, obsTimeout=5000, viewConns=10, viewTimeout=75000, viewWorkers=1, configCheck=10, reconnectInt=1100, failureMode=Redistribute, hashAlgo=NATIVE_HASH}
2014-03-16 17:30:42.390 INFO com.couchbase.client.CouchbaseConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@f8ae79
2014-03-16 17:30:42.468 INFO com.couchbase.client.CouchbaseClient: viewmode property isn't defined. Setting viewmode to production mode
2014-03-16 17:30:42.703 INFO net.spy.memcached.auth.AuthThread: Authenticated to localhost/127.0.0.1:11210

and here is my java class:

public class Test_ {

public static void main(String[] args) throws Exception {

// (Subset) of nodes in the cluster to establish a connection
List hosts = Arrays.asList(new URI("http://localhost:8091/pools"));

// Name of the Bucket to connect to
String bucket = "trust";

// Password of the bucket (empty) string if none
String password = "HIDDEN";

// Connect to the Cluster
CouchbaseClient client = new CouchbaseClient(hosts, bucket, password);

// Store a Document
client.set("33", "test my java code").get();

// Retreive the Document and print it
//System.out.println(client.get("33"));

// Shutting down properly
client.shutdown();
}
}
Was it helpful?

Solution

Solved, it was just the firewall blocking the port 11210.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top