spring-boot - 在 Spring Boot 中找不到 Couchbase 配置
问题描述
我正在尝试创建一个简单的 Spring Boot 应用程序。当我运行应用程序时,它无法开始给出此错误:
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/data/couchbase/config/AbstractCouchbaseDataConfiguration.class] cannot be opened because it does not exist
我没有使用 Couchbase,但它仍然显示此错误。我的 pom.xml 文件:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
解决方案
要开始使用 Couchbase,您需要添加 Spring Boot Starter 依赖项:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-couchbase</artifactId>
</dependency>
有关更多详细信息,请参见此处。
注意:如果不确定需要哪些依赖项,可以使用Spring Initializr 。
推荐阅读
- c# - 使用多个 TestCaseSource 属性执行 Nunit 测试用例
- mysql - 在 MySQL 中拆分值以插入不同的行
- html - 在Angular中替换innerHTML不必要地关闭标签
- matlab - 计算月中的天数 (MATLAB)
- python - Python selenium:元素不可交互
- c++ - 如何将一个数字分成几个不相等但不断增加的数字 [用于发送 PlaceOrder(OP_BUY,lots) 合约 XTO]
- git - 如何在 Gerrit 推送主题中转义空格?
- actions-on-google - 提交 Google Assistant 进行 Alpha 测试时是否有地域限制?
- service-worker - 如何手动终止正在运行的 Service Worker
- python - Django - 删除按钮未重定向到正确的路径