【发布时间】:2020-08-31 05:32:45
【问题描述】:
我正在开发一个 Springboot 应用程序,它连接到远程 Couchbase 服务器以获取数据。该应用程序在我机器上的本地 Couchbase 服务器上运行良好。但是当我为远程数据库配置 API 属性时,它会抛出 java.util.concurrent.TimeoutException。以下是我的错误日志。
2020-08-31 08:50:50.596 WARN 12692 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'fileUploadController': Unsatisfied dependency expressed through field 'predictionService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'predictionServiceImpl': Unsatisfied dependency expressed through field 'predictionDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'predictionDaoImpl': Unsatisfied dependency expressed through field 'predictionRepository'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'couchbaseRepositoryOperationsMapping' defined in class path resource [com/example/couchbaseService/Configuration/CouchbaseConfiguration.class]: Unsatisfied dependency expressed through method 'repositoryOperationsMapping' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseTemplate' defined in class path resource [com/example/couchbaseService/Configuration/CouchbaseConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.couchbase.core.CouchbaseTemplate]: Factory method 'couchbaseTemplate' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseBucket' defined in class path resource [com/example/couchbaseService/Configuration/CouchbaseConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.couchbase.client.java.Bucket]: Factory method 'couchbaseClient' threw exception; nested exception is java.lang.RuntimeException: java.util.concurrent.TimeoutException
2020-08-31 08:50:50.642 INFO 12692 --- [ main] c.c.client.core.env.CoreEnvironment : Shutdown kvIoPool: success
2020-08-31 08:50:50.645 INFO 12692 --- [ main] c.c.client.core.env.CoreEnvironment : Shutdown viewIoPool: success
2020-08-31 08:50:50.652 INFO 12692 --- [ main] c.c.client.core.env.CoreEnvironment : Shutdown queryIoPool: success
2020-08-31 08:50:50.656 INFO 12692 --- [ main] c.c.client.core.env.CoreEnvironment : Shutdown searchIoPool: success
2020-08-31 08:50:50.659 INFO 12692 --- [ main] c.c.client.core.env.CoreEnvironment : Shutdown Core Scheduler: success
2020-08-31 08:50:50.659 INFO 12692 --- [ Thread-5] c.c.client.core.env.CoreEnvironment : Shutdown Netty: success
2020-08-31 08:50:50.662 INFO 12692 --- [ main] c.c.client.core.env.CoreEnvironment : Shutdown Runtime Metrics Collector: success
2020-08-31 08:50:50.666 INFO 12692 --- [ main] c.c.client.core.env.CoreEnvironment : Shutdown Latency Metrics Collector: success
2020-08-31 08:50:50.683 INFO 12692 --- [ cb-io-1-2] c.c.client.core.endpoint.Endpoint : [][KeyValueEndpoint]: Got notified from Channel as inactive, attempting reconnect.
2020-08-31 08:50:50.690 INFO 12692 --- [entExecutor-2-2] c.c.client.core.env.CoreEnvironment : Shutdown IoPool: success
2020-08-31 08:50:50.703 INFO 12692 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
由于我无法找出原因,我在不同的 Windows 机器上测试了 API,所有尝试都给出了相同的错误。但是,API 在 MacOS 机器上成功启动并且工作正常。我正在使用 Java 11 和 Couchbase 企业版 6.5.0。我的springboot版本是2.0.1。任何人都可以帮助我找出原因吗?谢谢。
【问题讨论】:
-
您检查过防火墙或防病毒设置吗?
-
我禁用了防火墙并再次尝试。但问题依然存在。
标签: java spring-boot couchbase