我正在使用Couchbase 3.0而且我遇到了这个问题,当我尝试同时打开两个存储桶时它给了我错误java.util.concurrent.TimeoutException
。
我有一个案例,我必须同时打开两个桶。当我评论其中一个开桶行时,代码工作得很好,但是一旦我想打开两个桶,它就会给我一个例外。
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 :(得分:0)
我升级了Couchbase SDK的版本,现在不会出现问题!我认为这可能是版本问题!如果其他人发现此问题,请尝试升级Couchbase SDK以解决此错误!
P.S。这是一个很长的聊天,因此我在这里给出了这个答案!