Tomcat但不是Jetty:NoSuchMethodError:javax.persistence.JoinColumn.foreignKey()Ljavax / persistence / ForeignKey [英] Tomcat but not Jetty: NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey

查看:243
本文介绍了Tomcat但不是Jetty:NoSuchMethodError:javax.persistence.JoinColumn.foreignKey()Ljavax / persistence / ForeignKey的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将我的Wicket 6应用程序从Spring 3升级到Spring 4.



当我在Jetty 7上本地运行应用程序时,它运行良好。



当我将它部署到Tomcat 7时,出现以下错误:
$ b


[2014 -05-07 10:20:47,121] ERROR [org.springframework.web.context.ContextLoader]上下文初始化失败
org.springframework.beans.factory.BeanCreationException:在ServletContext中定义名称为'sessionFactory'的Bean时创建错误资源[/WEB-INF/applicationContext.xml]:调用init方法失败;嵌套异常是java.lang.NoSuchMethodError:javax.persistence.JoinColumn.foreignKey()Ljavax / persistence / ForeignKey;

这是一个Tomcat问题或者我应该继续尝试解决嵌套异常java.lang.NoSuchMethodError:javax.persistence.JoinColumn.foreignKey()?



如果问题是确实与外键,那么为什么这个问题不会发生在Jetty上?



spring.version 4.0.4.RELEASE



hibernate.version 4.3.5.Final

dataSource:class =org.apache.commons.dbcp.BasicDataSourcedestroy-method =close p>

解决方案

嵌套异常是java.lang.NoSuchMethodError:javax.persistence.JoinColumn.foreignKey()Ljavax / persistence / ForeignKey



发生此异常的javax.persistence.ForeignKey类存在冲突版本。检查你的classpath,如果你正在使用maven检查依赖关系。


I have recently upgraded my Wicket 6 application from Spring 3 to Spring 4.

When I run the application locally on Jetty 7, it runs fine.

When I deploy it to Tomcat 7, I get the following error:

[2014-05-07 10:20:47,121] ERROR [org.springframework.web.context.ContextLoader] Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;

Is this a Tomcat issue or should I just go ahead and try to solve the nested exception java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()?

If the issue is indeed with the foreignKey, then why does the problem not occur on Jetty?

spring.version 4.0.4.RELEASE

hibernate.version 4.3.5.Final

dataSource: class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"

解决方案

nested exception is java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey

This exception occurs of there are conflicting version of javax.persistence.ForeignKey class. Check your classpath and if you are using maven check the dependencies.

这篇关于Tomcat但不是Jetty:NoSuchMethodError:javax.persistence.JoinColumn.foreignKey()Ljavax / persistence / ForeignKey的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆