简体   繁体   English

javax.persistence.PersistenceContext.synchronization()中的错误

[英]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.

相关问题 java.lang.NoSuchMethodError: javax.persistence.PersistenceContext.synchronization - java.lang.NoSuchMethodError: javax.persistence.PersistenceContext.synchronization 创建EJB Provider javax.persistence.PersistenceContext.synchronization()Ljavax / persistence / SynchronizationType - create EJB Provider javax.persistence.PersistenceContext.synchronization()Ljavax/persistence/SynchronizationType 如何更正 spring boot 应用程序的类路径,使其包含单个兼容版本的 javax.persistence.PersistenceContext? - How to correct the classpath of spring boot application so that it contains a single, compatible version of javax.persistence.PersistenceContext? 如何解决“javax.persistence.PersistenceContext 与签名者信息不匹配”问题? - How to resolve the 'javax.persistence.PersistenceContext does not match signer information' problem? 导入javax.persistence.EntityManager错误 - import javax.persistence.EntityManager error 使用JPA,JavaFX和Maven,出现NoClassDefFoundError错误:javax / persistence / Persistence Intellij - Using JPA, JavaFX and Maven, error of NoClassDefFoundError: javax/persistence/Persistence Intellij 错误javax.persistence.TransactionRequiredException:没有事务正在进行 - Error javax.persistence.TransactionRequiredException: no transaction is in progress 无法使用@PersistenceContext注入EntityManager [将持久性单元注入CDI托管Bean时出错。] - Cant inject EntityManager with @PersistenceContext [Error injecting persistence unit into CDI managed bean.] "Lombok + QueryDsl + Mapstruct:错误编译:java.lang.NoClassDefFoundError:javax\/persistence\/Entity:javax.persistence.Entity" - Lombok + QueryDsl + Mapstruct: error compiling: java.lang.NoClassDefFoundError: javax/persistence/Entity: javax.persistence.Entity 持久性单元错误:javax.persistence.PersistenceException:没有命名 EntityManager 的持久性提供程序 - Persistence unit error: javax.persistence.PersistenceException: No Persistence provider for EntityManager named
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM