2015-08-21 96 views
2

我正在使用Couchbase 3.0而我正面臨這個問題,即當我嘗試同時打開兩個桶時,它給我提供了錯誤java.util.concurrent.TimeoutExceptionCouchbase Java SDK:併發超時異常

我有一個情況,我必須同時打開兩個桶。當我評論其中一個存儲桶開放代碼時,代碼工作的很好,但只要我想打開這兩個存儲桶,它就會給我一個例外。

Java的SDK版本2.1.3是

java.lang.RuntimeException: java.util.concurrent.TimeoutException 
    at com.couchbase.client.java.util.Blocking.blockForSingle(Blocking.java:93) ~[java-client-2.1.3.jar:2.1.3] 
    at com.couchbase.client.java.CouchbaseCluster.openBucket(CouchbaseCluster.java:108) ~[java-client-2.1.3.jar:2.1.3] 
    at com.couchbase.client.java.CouchbaseCluster.openBucket(CouchbaseCluster.java:94) ~[java-client-2.1.3.jar:2.1.3] 
    at com.couchbase.client.java.CouchbaseCluster.openBucket(CouchbaseCluster.java:84) ~[java-client-2.1.3.jar:2.1.3] 
    at com.trakinvest.core.db.DB$CouchbaseService.bucket(DB.scala:155) ~[classes/:na] 
    at com.trakinvest.core.service.SearchServiceSpec$.<init>(SearchServiceSpec.scala:26) [test-classes/:na] 
    at com.trakinvest.core.service.SearchServiceSpec$.<clinit>(SearchServiceSpec.scala) [test-classes/:na] 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [na:1.8.0_51] 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [na:1.8.0_51] 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [na:1.8.0_51] 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422) [na:1.8.0_51] 
    at org.specs2.reflect.Classes$class.createInstanceFor(Classes.scala:154) [specs2-common_2.11-2.3.12.jar:2.3.12] 
    at org.specs2.reflect.Classes$.createInstanceFor(Classes.scala:207) [specs2-common_2.11-2.3.12.jar:2.3.12] 
    at org.specs2.reflect.Classes$$anonfun$createInstanceOfEither$1.apply(Classes.scala:145) [specs2-common_2.11-2.3.12.jar:2.3.12] 
    at org.specs2.reflect.Classes$$anonfun$createInstanceOfEither$1.apply(Classes.scala:145) [specs2-common_2.11-2.3.12.jar:2.3.12] 
    at scala.Option.map(Option.scala:146) [scala-library-2.11.6.jar:na] 
    at org.specs2.reflect.Classes$class.createInstanceOfEither(Classes.scala:145) [specs2-common_2.11-2.3.12.jar:2.3.12] 
    at org.specs2.reflect.Classes$.createInstanceOfEither(Classes.scala:207) [specs2-common_2.11-2.3.12.jar:2.3.12] 
    at org.specs2.reflect.Classes$class.org$specs2$reflect$Classes$$createInstanceForConstructor(Classes.scala:118) [specs2-common_2.11-2.3.12.jar:2.3.12] 
    at org.specs2.reflect.Classes$$anonfun$4.apply(Classes.scala:98) [specs2-common_2.11-2.3.12.jar:2.3.12] 
    at org.specs2.reflect.Classes$$anonfun$4.apply(Classes.scala:98) [specs2-common_2.11-2.3.12.jar:2.3.12] 
    at scala.collection.immutable.List.map(List.scala:273) [scala-library-2.11.6.jar:na] 
    at org.specs2.reflect.Classes$class.tryToCreateObjectEither(Classes.scala:98) [specs2-common_2.11-2.3.12.jar:2.3.12] 
    at org.specs2.reflect.Classes$.tryToCreateObjectEither(Classes.scala:207) [specs2-common_2.11-2.3.12.jar:2.3.12] 
    at org.specs2.reflect.Classes$class.tryToCreateObject(Classes.scala:70) [specs2-common_2.11-2.3.12.jar:2.3.12] 
    at org.specs2.reflect.Classes$.tryToCreateObject(Classes.scala:207) [specs2-common_2.11-2.3.12.jar:2.3.12] 
    at org.specs2.specification.SpecificationStructure$$anonfun$createSpecificationFromClassOrObject$1.apply(BaseSpecification.scala:132) [specs2-core_2.11-2.3.12.jar:2.3.12] 
    at org.specs2.specification.SpecificationStructure$$anonfun$createSpecificationFromClassOrObject$1.apply(BaseSpecification.scala:132) [specs2-core_2.11-2.3.12.jar:2.3.12] 
    at scala.Option.orElse(Option.scala:289) [scala-library-2.11.6.jar:na] 
    at org.specs2.specification.SpecificationStructure$.createSpecificationFromClassOrObject(BaseSpecification.scala:132) [specs2-core_2.11-2.3.12.jar:2.3.12] 
    at org.specs2.specification.SpecificationStructure$.createSpecificationEither(BaseSpecification.scala:117) [specs2-core_2.11-2.3.12.jar:2.3.12] 
    at org.specs2.runner.SbtRunner.org$specs2$runner$SbtRunner$$specificationRun(SbtRunner.scala:73) [specs2-core_2.11-2.3.12.jar:2.3.12] 
    at org.specs2.runner.SbtRunner$$anonfun$newTask$1$$anon$5.execute(SbtRunner.scala:59) [specs2-core_2.11-2.3.12.jar:2.3.12] 
    at sbt.ForkMain$Run$2.call(ForkMain.java:294) [test-agent-0.13.8.jar:0.13.8] 
    at sbt.ForkMain$Run$2.call(ForkMain.java:284) [test-agent-0.13.8.jar:0.13.8] 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_51] 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_51] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_51] 
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_51] 
Caused by: java.util.concurrent.TimeoutException: null 
+0

也許這個:https://issues.couchbase.com/browse/JVMCBC-79。似乎阻止在錯誤的地方進行的調用可能導致這種情況發生。儘管我自己沒有足夠的細節。 –

+0

有什麼方法可以解決它 –

+1

你能提供你的代碼的提取? – DaveR

回答

0

我已經升級Couchbase SDK的版本,現在不會發生的問題!我認爲這可能是一個版本問題!如果其他人發現此問題,請嘗試升級Couchbase SDK以解決此錯誤!

P.S.這是一個很長的聊天,因此我在這裏給出這個答案!