异常:Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z

Spring3.0 + Hibernate3.5:
启动服务器报:
Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z

在hibernate3.5之前,我们运用hibernate开发J2EE项目通常会引以下几个jar包:
hibernate核心包:hibernate3.jar
持久化:ejb3-persistence.jar
则javax.persistence.OneToMany.class就在ejb3-persistence.jar中。

在hibernate3.5及其以后,运用hibernate开发J2EE项目通常会引以下几个jar包:
hibernate核心包:hibernate3.jar
持久化:hibernate-jpa-2.0-XXX.jar
hibernate-jpa-2.0-XXX.jar中已将包含了ejb3-persistence.jar所有类库和其他一些扩展,固然javax.persistence.OneToMany.class也就在hibernate-jpa-2.0-XXX.jar中了。
所以当我们从3.5以下版本上级到3.5以上版本时,很容易出现不知道哪些jar包该保留哪些该删掉,因而两个jar包同时存在,出现了这个冲突异常。

时间: 2024-12-22 15:01:47

异常:Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z的相关文章

异常:Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z/Caused by: java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreign

Spring3.0 + Hibernate3.5:启动服务器报:Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z 在hibernate3.5之前,我们运用hibernate开发J2EE项目通常会引以下几个jar包:hibernate核心包:hibernate3.jar持久化:ejb3-persistence.jar则javax.persistence.OneToMany.cla

Caused by: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode

进行 spring mvc jpa整合时.Junit方法测试时. 异常: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested excep

Caused by: java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/

Caused by: Java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey; 报错原因: myeclipse中 JAVAEE6.0中的  javax.persistence.jar与 hibernate中的hibernate-jpa-2.1-api-1.0.0.Final.jar冲突 而我采取的措施是删除了JAVAEE6.0的库,运行就正常了,然后在加

Caused by java lang NoSuchMethodError javax persistence Ta

1.错误描述 WARN:2015-05-01 16:45:37[main] - Exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'baseDaoImpl': Injection of resource depen

Weblogic启动时报错javax.persistence.OneToMany.orphanRemoval()Z

当在weblogic10上启动时又报错,网上查询解决方案发现很多答案文不对题,都是基于代码开发或者替换包等操作,但是我这是weblogic且应用在原来的服务器上是正常运行没有报错,又详细比对了新老服务器上weblogic和jdk的版本,发现大小版本也一样. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fpykjService': Injection of resou

Caused by: java.lang.ClassNotFoundException: javax.persistence.Entity

1.错误描写叙述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop } 2014-7-12 19:41:17 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.29 usi

【转】java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;

最近在配置最新的ssh(struts2.3.16.3+hibernate4.3.7+spring4.1.2)的时候遇到的这个错误提示,后来在网上找了半天都不能解决,虽然有个说法是model对象用这样@Entity(name = "UserInfo")的方式来实现,但是这样的话对象和表明必须一致,后来找到如下原因:希望对大家有所帮助,特分享如下: java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/p

报错org.apache.catalina.LifecycleException caused by java.lang.NoSuchMethodError: javax.servlet.ServletContext.getClassLoader()Ljava/lang/ClassLoader

今天将tomcat6更换成了tomcat7,报错的内容 严重: A child container failed during startjava.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/webandr

Caused by: java.lang.NoSuchMethodError:javax.servlet.http.HttpServletRequest.getServletContext()L

在做项目的时候,出现Caused by: java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getServletContext()L这个问题,也就是使用request.getServletContext().getRealPath("/")这个报错,感觉好郁闷,看了别人写的文章,可能是tomcat版本过低,我之前用的是tomcat6,现在我改成tomcat7,问题解决了,故分享给大家