我正试图在maven中构建我的Jhipster Spring引导应用程序。但是,Maven并不是在调试模式下构建的。否则,它就能正常工作了。
我添加了下面的依赖项,没有帮助。
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
</dependency>Description:
An attempt was made to call the method javax.persistence.PersistenceContext.synchronization()Ljavax/persistence/SynchronizationType; but it does not exist. Its class, javax.persistence.PersistenceContext, is available from the following locations:
jar:file:/C:/Users/User/Documents/audio-book-admin/lib/javax.persistence.jar!/javax/persistence/PersistenceContext.class
jar:file:/C:/Users/User/.m2/repository/org/hibernate/javax/persistence/hibernate-jpa-2.1-api/1.0.2.Final/hibernate-jpa-2.1-api-1.0.2.Final.jar!/javax/persistence/PersistenceContext.class
jar:file:/C:/Users/User/.m2/repository/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar!/javax/persistence/PersistenceContext.class
It was loaded from the following location:
file:/C:/Users/User/Documents/audio-book-admin/lib/javax.persistence.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of javax.persistence.PersistenceContext那么,如何正确地纠正我的应用程序的类路径来重新处理上述问题呢?我是新来的春天靴!
发布于 2019-04-18 06:10:27
首先在存储库中删除目录hibernate,然后进行maven干净安装,以便正确导入依赖项。
如果它仍然没有修复您的问题,那么创建一个maven树:依赖来检测哪些依赖导致问题,并将其排除在pom中。
https://stackoverflow.com/questions/55738538
复制相似问题