Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Couchbase | Couchbase Server 1.8.x

Tutorial.java not working

4 replies [Last post]
  • Login or register to post comments
Sun, 05/06/2012 - 14:44
Amit
Offline
Joined: 05/06/2012
Groups: None

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.

Top
  • Login or register to post comments
Sun, 05/06/2012 - 16:36
SteveC
Offline
Joined: 04/24/2012
Groups: None

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

Top
  • Login or register to post comments
Mon, 05/07/2012 - 01:40
Amit
Offline
Joined: 05/06/2012
Groups: None

Thanks a lot. That corrected the error. Only thing is that bucket name should be mentioned i.e. CouchbaseConnectionFactory(baseURIs, "default", "");

Top
  • Login or register to post comments
Mon, 05/07/2012 - 10:29
ingenthr
Offline
Joined: 03/16/2010
Groups:

Yes, that's correct. Sorry for the issue in the docs. We'll get that fixed right away.

Top
  • Login or register to post comments
Wed, 06/13/2012 - 09:15
rags
rags's picture
Offline
Joined: 12/29/2011
Groups: None

The documentation issues have been fixed.

Rags

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker