- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在使用 Spring Boot 在具有许多 Hibernate 依赖项的现有项目上做一个原型(prototype)。我正在尝试定义一个自定义的 LocalEntityManagerFactoryBean,但正是在这里我收到了这个错误:
java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
我已经尝试更新我的 hibernate 版本(由于项目向后兼容性导致许多其他编译错误而无法使用所有最新版本)但是使用以下 hibernate 依赖关系图可以使其编译但仍然会出现此运行时依赖关系错误。当我搜索此错误时,所有结果都指向 Hibernate 4 和 JPA 2.1 的升级。我们已经在使用 Hibernate 4+,所以只是将版本更改得更高一点但没有成功。以下来自 Gradle 的依赖关系图显示我没有任何旧版本的“org.hibernate.javax.persistence:hibernate-jpa-2.0-api”
| +--- org.hibernate:hibernate-entitymanager:4.3.7.Final
| | +--- org.hibernate:hibernate-core:4.3.7.Final
| | | +--- org.hibernate.common:hibernate-commons-annotations:4.0.5.Final
| | | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | +--- org.hibernate.common:hibernate-commons-annotations:4.0.5.Final (*)
| | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| +--- org.hibernate:hibernate-validator:5.1.3.Final
| | | +--- org.hibernate:ejb3-persistence:1.0.2.GA
| | | | | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | | | | +--- org.hibernate:hibernate-core:4.2.0.Final -> 4.3.7.Final (*)
| | | | | +--- org.hibernate:hibernate-entitymanager:4.2.0.Final -> 4.3.7.Final (*)
| | | | | +--- org.hibernate:hibernate-annotations:3.5.6-Final
| | | | | | +--- org.hibernate:hibernate-core:3.5.6-Final -> 4.3.7.Final (*)
| | | | | | +--- org.hibernate:hibernate-commons-annotations:3.2.0.Final
| | | | | +--- org.hibernate:hibernate-validator:4.2.0.Final -> 5.1.3.Final (*)
| | | | | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| | | | | | | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | | | | | | +--- org.hibernate:hibernate-core:4.2.0.Final -> 4.3.7.Final (*)
| | | | | | | +--- org.hibernate:hibernate-entitymanager:4.2.0.Final -> 4.3.7.Final (*)
| | | | | | | +--- org.hibernate:hibernate-annotations:3.5.6-Final (*)
| | | | | | | +--- org.hibernate:hibernate-validator:4.2.0.Final -> 5.1.3.Final (*)
| | | | | | | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | +--- org.hibernate:hibernate-core:4.2.0.Final -> 4.3.7.Final (*)
| | +--- org.hibernate:hibernate-entitymanager:4.2.0.Final -> 4.3.7.Final (*)
| | +--- org.hibernate:hibernate-annotations:3.5.6-Final (*)
| | +--- org.hibernate:hibernate-validator:4.2.0.Final -> 5.1.3.Final (*)
| | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| | | | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| +--- org.hibernate:hibernate-entitymanager:4.3.7.Final
| | +--- org.hibernate:hibernate-core:4.3.7.Final
| | | +--- org.hibernate.common:hibernate-commons-annotations:4.0.5.Final
| | | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | +--- org.hibernate.common:hibernate-commons-annotations:4.0.5.Final (*)
| | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| +--- org.hibernate:hibernate-validator:5.1.3.Final
| | | +--- org.hibernate:ejb3-persistence:1.0.2.GA
| | | | | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | | | | +--- org.hibernate:hibernate-core:4.2.0.Final -> 4.3.7.Final (*)
| | | | | +--- org.hibernate:hibernate-entitymanager:4.2.0.Final -> 4.3.7.Final (*)
| | | | | +--- org.hibernate:hibernate-annotations:3.5.6-Final
| | | | | | +--- org.hibernate:hibernate-core:3.5.6-Final -> 4.3.7.Final (*)
| | | | | | +--- org.hibernate:hibernate-commons-annotations:3.2.0.Final
| | | | | +--- org.hibernate:hibernate-validator:4.2.0.Final -> 5.1.3.Final (*)
| | | | | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| | | | | | | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | | | | | | +--- org.hibernate:hibernate-core:4.2.0.Final -> 4.3.7.Final (*)
| | | | | | | +--- org.hibernate:hibernate-entitymanager:4.2.0.Final -> 4.3.7.Final (*)
| | | | | | | +--- org.hibernate:hibernate-annotations:3.5.6-Final (*)
| | | | | | | +--- org.hibernate:hibernate-validator:4.2.0.Final -> 5.1.3.Final (*)
| | | | | | | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | +--- org.hibernate:hibernate-core:4.2.0.Final -> 4.3.7.Final (*)
| | +--- org.hibernate:hibernate-entitymanager:4.2.0.Final -> 4.3.7.Final (*)
| | +--- org.hibernate:hibernate-annotations:3.5.6-Final (*)
| | +--- org.hibernate:hibernate-validator:4.2.0.Final -> 5.1.3.Final (*)
| | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| | | | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| +--- org.hibernate:hibernate-entitymanager:4.3.7.Final
| | +--- org.hibernate:hibernate-core:4.3.7.Final
| | | +--- org.hibernate.common:hibernate-commons-annotations:4.0.5.Final
| | | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | +--- org.hibernate.common:hibernate-commons-annotations:4.0.5.Final (*)
| | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| +--- org.hibernate:hibernate-validator:5.1.3.Final
| | | +--- org.hibernate:ejb3-persistence:1.0.2.GA
| | | | | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | | | | +--- org.hibernate:hibernate-core:4.2.0.Final -> 4.3.7.Final (*)
| | | | | +--- org.hibernate:hibernate-entitymanager:4.2.0.Final -> 4.3.7.Final (*)
| | | | | +--- org.hibernate:hibernate-annotations:3.5.6-Final
| | | | | | +--- org.hibernate:hibernate-core:3.5.6-Final -> 4.3.7.Final (*)
| | | | | | +--- org.hibernate:hibernate-commons-annotations:3.2.0.Final
| | | | | +--- org.hibernate:hibernate-validator:4.2.0.Final -> 5.1.3.Final (*)
| | | | | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| | | | | | | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | | | | | | +--- org.hibernate:hibernate-core:4.2.0.Final -> 4.3.7.Final (*)
| | | | | | | +--- org.hibernate:hibernate-entitymanager:4.2.0.Final -> 4.3.7.Final (*)
| | | | | | | +--- org.hibernate:hibernate-annotations:3.5.6-Final (*)
| | | | | | | +--- org.hibernate:hibernate-validator:4.2.0.Final -> 5.1.3.Final (*)
| | | | | | | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | +--- org.hibernate:hibernate-core:4.2.0.Final -> 4.3.7.Final (*)
| | +--- org.hibernate:hibernate-entitymanager:4.2.0.Final -> 4.3.7.Final (*)
| | +--- org.hibernate:hibernate-annotations:3.5.6-Final (*)
| | +--- org.hibernate:hibernate-validator:4.2.0.Final -> 5.1.3.Final (*)
| | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| | | | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| +--- org.hibernate:hibernate-entitymanager:4.3.7.Final
| | +--- org.hibernate:hibernate-core:4.3.7.Final
| | | +--- org.hibernate.common:hibernate-commons-annotations:4.0.5.Final
| | | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | +--- org.hibernate.common:hibernate-commons-annotations:4.0.5.Final (*)
| | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| +--- org.hibernate:hibernate-validator:5.1.3.Final
| | | +--- org.hibernate:ejb3-persistence:1.0.2.GA
| | | | | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | | | | +--- org.hibernate:hibernate-core:4.2.0.Final -> 4.3.7.Final (*)
| | | | | +--- org.hibernate:hibernate-entitymanager:4.2.0.Final -> 4.3.7.Final (*)
| | | | | +--- org.hibernate:hibernate-annotations:3.5.6-Final
| | | | | | +--- org.hibernate:hibernate-core:3.5.6-Final -> 4.3.7.Final (*)
| | | | | | +--- org.hibernate:hibernate-commons-annotations:3.2.0.Final
| | | | | +--- org.hibernate:hibernate-validator:4.2.0.Final -> 5.1.3.Final (*)
| | | | | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| | | | | | | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | | | | | | +--- org.hibernate:hibernate-core:4.2.0.Final -> 4.3.7.Final (*)
| | | | | | | +--- org.hibernate:hibernate-entitymanager:4.2.0.Final -> 4.3.7.Final (*)
| | | | | | | +--- org.hibernate:hibernate-annotations:3.5.6-Final (*)
| | | | | | | +--- org.hibernate:hibernate-validator:4.2.0.Final -> 5.1.3.Final (*)
| | | | | | | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | +--- org.hibernate:hibernate-core:4.2.0.Final -> 4.3.7.Final (*)
| | +--- org.hibernate:hibernate-entitymanager:4.2.0.Final -> 4.3.7.Final (*)
| | +--- org.hibernate:hibernate-annotations:3.5.6-Final (*)
| | +--- org.hibernate:hibernate-validator:4.2.0.Final -> 5.1.3.Final (*)
| | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| | | | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| +--- org.hibernate:hibernate-entitymanager:4.3.7.Final
| | +--- org.hibernate:hibernate-core:4.3.7.Final
| | | +--- org.hibernate.common:hibernate-commons-annotations:4.0.5.Final
| | | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | +--- org.hibernate.common:hibernate-commons-annotations:4.0.5.Final (*)
| | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| +--- org.hibernate:hibernate-validator:5.1.3.Final
| | | +--- org.hibernate:ejb3-persistence:1.0.2.GA
| | | | | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | | | | +--- org.hibernate:hibernate-core:4.2.0.Final -> 4.3.7.Final (*)
| | | | | +--- org.hibernate:hibernate-entitymanager:4.2.0.Final -> 4.3.7.Final (*)
| | | | | +--- org.hibernate:hibernate-annotations:3.5.6-Final
| | | | | | +--- org.hibernate:hibernate-core:3.5.6-Final -> 4.3.7.Final (*)
| | | | | | +--- org.hibernate:hibernate-commons-annotations:3.2.0.Final
| | | | | +--- org.hibernate:hibernate-validator:4.2.0.Final -> 5.1.3.Final (*)
| | | | | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| | | | | | | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | | | | | | +--- org.hibernate:hibernate-core:4.2.0.Final -> 4.3.7.Final (*)
| | | | | | | +--- org.hibernate:hibernate-entitymanager:4.2.0.Final -> 4.3.7.Final (*)
| | | | | | | +--- org.hibernate:hibernate-annotations:3.5.6-Final (*)
| | | | | | | +--- org.hibernate:hibernate-validator:4.2.0.Final -> 5.1.3.Final (*)
| | | | | | | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | +--- org.hibernate:hibernate-core:4.2.0.Final -> 4.3.7.Final (*)
| | +--- org.hibernate:hibernate-entitymanager:4.2.0.Final -> 4.3.7.Final (*)
| | +--- org.hibernate:hibernate-annotations:3.5.6-Final (*)
| | +--- org.hibernate:hibernate-validator:4.2.0.Final -> 5.1.3.Final (*)
| | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
| | | | +--- net.sf.beanlib:beanlib-hibernate:5.0.3beta
任何指针都会有很大帮助。
谢谢,
水稻
最佳答案
尝试排除不需要的依赖项并为需要的依赖项强制执行版本。例如:
configurations.all { conf ->
exclude group: 'org.hibernate', module: 'hibernate-annotations'
resolutionStrategy {
// Forces one verion among the project
force "org.hibernate.common:hibernate-commons-annotations:4.0.5.Final"
}
}
关于java - spring boot Hibernate报错java.lang.NoSuchMethodError : javax. persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27373725/
这个问题已经有答案了: How to properly install and configure JSF libraries via Maven? (1 个回答) 已关闭 6 年前。 我正在使用wi
这是我的第二个。无法运行 Tomcat 服务器(我不知道为什么)但我有一个奇怪的错误(由)引起。 这是我的 pom.xml 代码: 4.0.0 ElPsyCongroo E
在 Spring-MVC 应用程序中,我尝试使用 validator 。我将注释 @NotEmpty 和 @Email 放在我的实体之一上,当我尝试验证它时,出现此错误: java.lang.NoSu
在 Weblogic 10.3.6 中部署我的应用程序时,我在服务器上遇到以下异常。有什么想法吗? weblogic.management.DeploymentException: at we
我正在使用 Hibernate 4、Spring 3 和 JSF 2.0 以及 Weblogic 10.3.6我在 DAO 类中有以下内容 CriteriaBuilder cb = e
我在 lib 目录中有persistence-api-1.0.2,hibernate-jpa-2.0-api-1.0.1.Final 和其他相关的jar。但是,当我部署war文件时,出现以下错误 ne
我正在 JSF 中开发一个应用程序。错误是: Caused by: java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Lja
我已经编写了一个自定义 RequestWrapper 来将 cookie 添加到请求中 @Override public Cookie[] getCookies() {
在 tomcat 8.0.33 中使用 jSTL 时出现错误 java.lang.NoSuchMethodError: javax.el.ExpressionFactory.getStreamEL
我正在使用 tomcat 7.0.82 和 JDK-“1.7.0_80”。当我将 jar com.ibm.ws.ejb.thinclient_7.0.0.jar 复制到 tomcat/lib 目录时,
我在 stackoverflow 上浏览了几篇关于同一问题的帖子;但没有解决问题。在一篇帖子中提到,“类路径上可能有 2 个不同版本的 hibernate-jpa-api。”因此,我检查了项目依赖关系
我正在学习在 Tomcat 上通过 RestEasy 使用 Spring、JPA 和 Hibernate。我已经尝试了一切,包括使用 JPA 2,但没有帮助。 这是堆栈跟踪: ---------- N
我有一个 Play Framework 应用程序,并且我使用 Hibernate 4.2.5.Final(通过 Maven 依赖项管理器检索)。我决定升级到 Hibernate 4.3.0.Final
我正在尝试使用 android studio 中的 Smack 库构建一个带有 XMPP 协议(protocol)的聊天应用程序。通过使用 Smack 版本 3.1.0,我可以轻松连接到 Open F
当我使用 eclipse tomcat 运行我的项目时,但是当我尝试使用我的 tomcat pc 时出现错误。如果有人可以帮助我,那将是友好的! org.springframework.beans.f
我正在升级 jpa、hibernate、spring 和 jdk 以启用 JPA 2.1 的新功能。但是我收到以下错误: java.lang.NoSuchMethodError: javax.pers
我有一个 Play Framework 应用程序,并且我正在使用 Hibernate 4.2.5.Final(通过 Maven 依赖项管理器检索)。我决定升级到 Hibernate 4.3.0.Fin
我正在使用 jboss 4.2.3 和 Metro。我部署了一个 EJB 3.0 Web 服务,没有出现错误,但是当我尝试调用它的 wsdl 时,它会抛出:java.lang.NoClassDefFo
我是 Websphere 应用程序服务器的新手。请让我知道我哪里做错了。我收到 java.lang.NoSuchMethodError: javax.persistence.JoinColumn.fo
我遇到了这个奇怪的错误,我不知道是什么原因造成的...完整的 LogCat: 06-24 13:15:07.878: W/dalvikvm(20470): VFY: unable to find cl
我是一名优秀的程序员,十分优秀!