Facing an issue "Could not find class [org.springframework.data.jdbc.repository.config.JdbcConfiguration] in spring-boot app

huangapple go评论92阅读模式
英文:

Facing an issue "Could not find class [org.springframework.data.jdbc.repository.config.JdbcConfiguration] in spring-boot app

问题

我有一个代码库,在一台机器上运行得很好,但在另一台机器上无法运行。虽然我能够无任何问题地收集所有的依赖项,但在运行主程序时却出现了错误。

虽然我无法复制粘贴问题,因为它在RDP中,但请在下面找到堆栈跟踪。任何解决方案都将对解决此问题非常有帮助。

Facing an issue "Could not find class [org.springframework.data.jdbc.repository.config.JdbcConfiguration] in spring-boot app

英文:

I have a code base which works perfectly on one of my machine but fails to run on another. While I am able to gather all dependencies without any issues I am getting error while running the main program.

While I am not able to copy paste the issue since its in RDP, please find below the stack trace. Any solutions would be of great help to resolve this issue.

Facing an issue "Could not find class [org.springframework.data.jdbc.repository.config.JdbcConfiguration] in spring-boot app

答案1

得分: 1

移除 pom.xml 中与 spring-boot-starter-jpa 相关的所有其他依赖项。

仅添加以下一个依赖项即可。

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
    <version>2.2.6.RELEASE</version> <!-- 如提到的(如果在父级别使用则可选)-->
</dependency>

就是这样。

英文:

Remove all other dependencies related to spring-boot-starter-jpa in pom.xml.

Add only one dependency below. That's enough.

&lt;dependency&gt;
	&lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
    &lt;version&gt;2.2.6.RELEASE&lt;/version&gt; &lt;!-- as mentioned (but optional if used at the parent level)--&gt;
&lt;/dependency&gt;

That's all.

huangapple
  • 本文由 发表于 2020年10月3日 13:09:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/64180932.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定