Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | SDKs | SDKs

JAVA AsyncConnectionManager, Timed out waiting for operation!!! Please help! (Console log included)

4 replies [Last post]
  • Login or register to post comments
Mon, 09/10/2012 - 08:39
derekdon
Offline
Joined: 09/10/2012
Groups: None

Hi Guys,

I wonder if anyone can shed any light on an issue I am having when I try to access a couchbase view from the Java SDK.

I am using the following class within a Scala/Java based Play Application to manage my Couchbase connection.

https://github.com/daschl/couchplay/blob/master/app/datasources/Couchbas...

It works great and I can add and retrieve data from the couchbase server, but I am now trying to access views I have defined which is proving problematic.

General startup output:

[info] application - Application has started
2012-09-10 16:10:16.476 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
2012-09-10 16:10:16.482 INFO com.couchbase.client.CouchbaseClient: viewmode set to development mode
2012-09-10 16:10:16.482 INFO com.couchbase.client.CouchbaseConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@6c6f18
2012-09-10 16:10:16.510 INFO com.couchbase.client.ViewConnection: Added 127.0.0.1/127.0.0.1:8092 to connect queue
[info] play - Application started (Dev)

All is well, but when the getView line of code below runs by accessing a http://localhost:9000/getProductAreas/someid/

val client = Couchbase.getConnection()
val view = client.getView("dev_product", "areas")

I get this output:

2012-09-10 16:10:16.651 INFO net.spy.memcached.auth.AuthThread: Authenticated to 127.0.0.1/127.0.0.1:11210
2012-09-10 16:10:51.610 INFO com.couchbase.client.http.AsyncConnectionManager: Opening new CouchDB connection
2012-09-10 16:10:51.612 ERROR com.couchbase.client.http.AsyncConnectionManager$ConnRequestCallback: /127.0.0.1:8092 - Session request failed
java.net.SocketException: Invalid argument: getsockname
at sun.nio.ch.Net.localInetAddress(Native Method)
at sun.nio.ch.Net.localAddress(Net.java:389)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:639)
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processSessionRequests(DefaultConnectingIOReactor.java:239)
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:313)
at com.couchbase.client.http.AsyncConnectionManager.execute(AsyncConnectionManager.java:84)
at com.couchbase.client.ViewNode$1.run(ViewNode.java:83)
at java.lang.Thread.run(Thread.java:722)
2012-09-10 16:10:51.613 ERROR com.couchbase.client.ViewNode: Failed to obtain connection. Cancelling op
[error] application -

! @6bj92epdh - Internal server error, for request [GET /getProductAreas/someid/] ->

play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[RuntimeException: Timed out waiting for operation]]
at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1-2.0.3.jar:2.0.3]
at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1-2.0.3.jar:2.0.3]
at akka.actor.Actor$class.apply(Actor.scala:318) [akka-actor-2.0.2.jar:2.0.2]
at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1-2.0.3.jar:2.0.3]
at akka.actor.ActorCell.invoke(ActorCell.scala:626) [akka-actor-2.0.2.jar:2.0.2]
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) [akka-actor-2.0.2.jar:2.0.2]
Caused by: java.lang.RuntimeException: Timed out waiting for operation
at com.couchbase.client.internal.HttpFuture.get(HttpFuture.java:67) ~[couchbase-client-1.1-dp.jar:1.1-dp]
at com.couchbase.client.CouchbaseClient.getView(CouchbaseClient.java:361) ~[couchbase-client-1.1-dp.jar:1.1-dp]
at controllers.Application$$anonfun$getProductAreas$1.apply(Application.scala:70) ~[classes/:na]
at controllers.Application$$anonfun$getProductAreas$1.apply(Application.scala:66) ~[classes/:na]
at play.api.mvc.Action$$anonfun$apply$4.apply(Action.scala:204) ~[play_2.9.1-2.0.3.jar:2.0.3]
at play.api.mvc.Action$$anonfun$apply$4.apply(Action.scala:204) ~[play_2.9.1-2.0.3.jar:2.0.3]
Caused by: java.util.concurrent.TimeoutException: Timed out waiting for operation
at com.couchbase.client.internal.HttpFuture.get(HttpFuture.java:79) ~[couchbase-client-1.1-dp.jar:1.1-dp]
at com.couchbase.client.internal.HttpFuture.get(HttpFuture.java:64) ~[couchbase-client-1.1-dp.jar:1.1-dp]
at com.couchbase.client.CouchbaseClient.getView(CouchbaseClient.java:361) ~[couchbase-client-1.1-dp.jar:1.1-dp]
at controllers.Application$$anonfun$getProductAreas$1.apply(Application.scala:70) ~[classes/:na]
at controllers.Application$$anonfun$getProductAreas$1.apply(Application.scala:66) ~[classes/:na]
at play.api.mvc.Action$$anonfun$apply$4.apply(Action.scala:204) ~[play_2.9.1-2.0.3.jar:2.0.3]

I have a feeling that the credentials defined in the Couchbase.java file aren't passed along to AsyncConnectionManager when it tries to open a new connection... I may be completely wrong.

Anyone have any idea on how to resolve this? Is a new connection required when accessing a view?

Many thanks,

Derek.

Top
  • Login or register to post comments
Tue, 09/11/2012 - 11:04
derekdon
Offline
Joined: 09/10/2012
Groups: None

It's okay folks, turns out I needed to downgrade to Java 1.6, all working now. Cheers!

By the way, I was tunnelling via Putty from a windows 8 laptop to Couchbase running on my Linux VPS and also needed to add a new forwarded port tunnel to Putty, 8092 / localhost:8092

Top
  • Login or register to post comments
Mon, 11/19/2012 - 20:33
nimaghamsari
Offline
Joined: 11/19/2012
Groups: None

Any solutions to this for people running Java 1.7?

Top
  • Login or register to post comments
Tue, 12/18/2012 - 01:05
Kuchipudi Sreelatha
Offline
Joined: 11/26/2012
Groups: None

Hi,
I face the same issue. The java version that I have is 1.6 but still I face the same issue.

Top
  • Login or register to post comments
Wed, 12/19/2012 - 10:18
daschl
Offline
Joined: 05/19/2012
Groups: None

Hi, can you please provide a strack tace that points to your problem? We've seen issues with the 1.7 SDK in the past, but not with 1.6. Thanks!

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