Tutorial.java not working
Hi,
I tried this code tutorial.java at http://www.couchbase.com/docs/couchbase-sdk-java-1.0/complete-tutorial-c....
BUt I am getting following error
java -cp .:couchbase-client-1.0.2.jar:spymemcached-2.8.0.jar:jettison-1.1.jar:netty-3.2.0.Final.jar:commons-codec-1.5.jar Tutorial 127.0.0.1
Connecting to 127.0.0.1
6 May, 2012 10:51:56 PM com.couchbase.client.vbucket.ConfigurationProviderHTTP readPools
WARNING: Connection problems with URI http://127.0.0.1:8091/pools ...skipping
java.io.IOException: Server returned HTTP response code: 401 for URL: http://127.0.0.1:8091/pools
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
at com.couchbase.client.vbucket.ConfigurationProviderHTTP.readToString(ConfigurationProviderHTTP.java:322)
at com.couchbase.client.vbucket.ConfigurationProviderHTTP.readPools(ConfigurationProviderHTTP.java:144)
at com.couchbase.client.vbucket.ConfigurationProviderHTTP.getBucketConfiguration(ConfigurationProviderHTTP.java:126)
at com.couchbase.client.CouchbaseConnectionFactory.getVBucketConfig(CouchbaseConnectionFactory.java:154)
at com.couchbase.client.CouchbaseClient.(CouchbaseClient.java:156)
at com.couchbase.client.CouchbaseClient.(CouchbaseClient.java:125)
at Tutorial.connect(Tutorial.java:111)
at Tutorial.run(Tutorial.java:82)
at Tutorial.main(Tutorial.java:66)
java.lang.NullPointerException
Exception in thread "main" java.lang.NullPointerException
at Tutorial.main(Tutorial.java:70)
Can anybody please guide me what wrong am I doing ?
I have installed 1.8 version on my laptop.
Thanks a lot. That corrected the error. Only thing is that bucket name should be mentioned i.e. CouchbaseConnectionFactory(baseURIs, "default", "");
Yes, that's correct. Sorry for the issue in the docs. We'll get that fixed right away.
The documentation issues have been fixed.
Rags
Change this line:
CouchbaseConnectionFactory cf = new
CouchbaseConnectionFactory(baseURIs, "rags", "changeit");
To:
CouchbaseConnectionFactory cf = new
CouchbaseConnectionFactory(baseURIs, "", "");
It should also be changed in the tutorial and the String literals should be described