com.example.CouchbaseRepository中的构造函数的参数0需要一个类型为'com.example.CatRepository'的bean,但找不到

时间:2019-09-01 09:02:20

标签: java spring-boot docker spring-data-jpa spring-data

我们有一个Spring Boot 2.1.7.RELEASE应用和一个Couchbaes DB

我们还有一个findAll方法,该方法在我们的存储库接口中继承:

@ViewIndexed(designDoc = "cat", viewName = "all")
public interface CatRepository extends CouchbasePagingAndSortingRepository<Cat, String>{
 // nothing here. all is inherited
}

该应用在某些环境(包括集成测试)下可以正常启动,但在其他环境下,我们会在启动时收到此错误,并且该应用无法加载:

  

说明:

     

com.example.CouchbaseRepository中的构造函数的参数0需要一个类型为com.example.CatRepository的bean。

     

操作:

     

考虑定义类型为“ com.example.CatRepository”的bean   在您的配置中。

更新

  1. 我们发现它与Couchbase中的权限无关。
  2. Docker中使用外部属性文件运行该应用程序时,似乎出现了问题,其命令行如下所示:

java -jar myApp.jar --spring.config.location=file:conf/properties.yml

0 个答案:

没有答案