Correct the classpath of your application so that it contains a single, compatible version of javax.

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6


前言

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.hibernate.jpa.boot.internal.PersistenceUnitInfoDescriptor.getValidationMode(PersistenceUnitInfoDescriptor.java:88)

The following method did not exist:

javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;

The method's class, javax.persistence.spi.PersistenceUnitInfo, is available from the following locations:

jar:file:/E:/JAVA/yycg_repository/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar!/javax/persistence/spi/PersistenceUnitInfo.class
jar:file:/E:/JAVA/yycg_repository/jakarta/persistence/jakarta.persistence-api/2.2.3/jakarta.persistence-api-2.2.3.jar!/javax/persistence/spi/PersistenceUnitInfo.class

The class hierarchy was loaded from the following locations:

javax.persistence.spi.PersistenceUnitInfo: file:/E:/JAVA/yycg_repository/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of javax.persistence.spi.PersistenceUnitInfo


Process finished with exit code 1

问题

我引入了JPA的一个包 不引入它 启动没问题 引入就报错 但是我还要用到jpa

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

后来发现不是它的问题
看最后一句报错

Correct the classpath of your application so that it contains a single, compatible version of javax.persistence.spi.PersistenceUnitInfo

这个说的是jar冲突,那么解决思路就应该是​​javax.persistence.spi.PersistenceUnitInfo​​​ 直接百度 网上就有很多解决jar冲突的
​然后就找到解决思路了:最后解决文章​​


阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: Java

“Correct the classpath of your application so that it contains a single, compatible version of javax.” 的相关文章