我们有一个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 在您的配置中。
更新:
Docker
中使用外部属性文件运行该应用程序时,似乎出现了问题,其命令行如下所示: java -jar myApp.jar --spring.config.location=file:conf/properties.yml