[英]Error in javax.persistence.PersistenceContext.synchronization()
I am trying to build my Jhipster Spring boot application in maven. 我正在尝试在Maven中构建Jhipster Spring引导应用程序。 However, Maven is not building in the debug mode.
但是,Maven不在调试模式下构建。 Otherwise, it is working fine.
否则,它工作正常。
I have added following dependency, didn't help. 我添加了以下依赖项,没有帮助。
<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
So, How can I properly correct classpath of my application to reslove the above issues? 因此,如何正确纠正应用程序的类路径以解决上述问题? I am new in Spring boot!
我是Spring Boot的新手!
First remove in your repository maven the directory hibernate and then make a maven clean install to re import correctly your dependencies. 首先在存储库maven中删除休眠目录,然后进行maven全新安装以正确重新导入依赖项。
if it still doesn't fix your problem make a maven tree:dependency to detect what dependence is causing issue and exclude it in your pom 如果仍然不能解决问题,则制作一个Maven树:依赖关系以检测导致问题的依赖关系,并将其排除在pom中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.