3.1.0.CR1 incompatible with Hibernate 3.3.0

Description

I'm getting this stacktrace after upgrading from Hibernate 3.3.0.CR2 to 3.3.0:

java.lang.NoSuchMethodError: org.hibernate.event.PreUpdateEvent.getSource()Lorg/hibernate/engine/SessionImplementor;
at org.hibernate.validator.event.ValidateEventListener.onPreUpdate(ValidateEventListener.java:177)
at org.hibernate.action.EntityUpdateAction.preUpdate(EntityUpdateAction.java:237)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:88)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1141)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:65)
at de.hska.kundenverwaltung.db.KundenverwaltungDaoImpl.findKundenByNachname(KundenverwaltungDaoImpl.java:67)
at de.hska.kundenverwaltung.KundenverwaltungImpl.updateKunde(KundenverwaltungImpl.java:392)
at de.hska.kundenverwaltung.rest.KundenverwaltungResource.updateKunde(KundenverwaltungResource.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.jersey.impl.model.method.dispatch.EntityParamDispatchProvider$TypeOutInvoker._dispatch(EntityParamDispatchProvider.java:132)
at com.sun.jersey.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:81)
at com.sun.jersey.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:133)
at com.sun.jersey.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
at com.sun.jersey.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
at com.sun.jersey.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
at com.sun.jersey.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:64)
at com.sun.jersey.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:680)
at com.sun.jersey.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:650)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:309)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at de.hska.util.HskaFilter.doFilter(HskaFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
at java.lang.Thread.run(Thread.java:619)

Environment

Hibernate 3.3.0, Hibernate Common Annotations 3.1.0.CR2, Hibernate Annotations 3.4.0.CR2, Hibernate EntityManager 3.4.0.CR2, Javassist, 3.8.1, CGLib 2.2, EHCache 1.5.0, SLF4J 1.5.2, JDK 1.6.0_07

Activity

Show:
Hardy Ferentschik
August 21, 2008, 8:23 AM

That's the right combination - HV 3.1.0.CR2 together with Hibernate 3.3.0.SP1

MichaelM
February 18, 2009, 9:44 PM

I'm getting the same error with 3.3.1-GA (Core) and HV 3.1.0-GA. I also tried HV 3.1.0 CR2 with 3.3.1-GA and get the same error.
Annotations- 3.4.0.GA, Commons-Annotations 3.1.0.GA, EntityManager 3.3.2.GA, Search 3.0.0.GA, testing 3.3.1.GA

Can anyone tell me what is wrong with this setup?

Hardy Ferentschik
February 19, 2009, 11:42 AM

The following is the dependency used in the current version of the code (https://svn.jboss.org/repos/hibernate/validator/trunk/hibernate-validator-legacy)

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.0.SP1</version>
</dependency>

Using this dependency works just fine. If I upgrade to 3.3.1.GA everything is fine as well

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.1.GA</version>
</dependency>

On the contrary if I change the dependecy to 3.3.0.GA, I even get compilation errors

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.0.GA</version>
</dependency>

If I recall correctly SP1 was required, because the methods in question got accidently removed in the 3.3.0.GA release.

Are you sure there is no other conflicting version of Hibernate in your classpath?

Albert Gorski
February 19, 2009, 12:51 PM

be careful -> I've the same problem when I run software on tomcat server and generate build.xml ANT file in eclipse rom MAVEN project.
Somehow there is a dependency to the hibernate.3.2.1.ga and this library/jar is also on the classpath in the tomcat lib application.
hibernate3.2.1.ga must be removed (or core must be before hibernate on the classpath).

I found that hibernate-commons-annotation-3.0.0.GA has got a reference to hibernate.3.2.1.ga what makes this PROBLEM and must be corrected that it references to the hibernate-core-3.3.1.GA .

Here is the classpath which "works" for me (extracted from maven build file):
activation-1.1.jar
ant-1.5.jar
ant-contrib-1.0b3.jar
antlr-2.7.6.jar
asm-1.5.3.jar
asm-attrs-1.5.3.jar
auco_ejb3-0.0.2.jar
cglib-2.1_3.jar
commons-beanutils-1.7.0.jar
commons-collections-3.1.jar
commons-digester-1.8.jar
commons-discovery-0.2.jar
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-lang-2.3.jar
commons-logging-1.1.1.jar
commons-math-1.1.jar
dom4j-1.6.1.jar
ehcache-1.2.3.jar
ejb3-persistence-1.0.2.GA.jar
ejb-api-3.0.jar
elvyx-1.0.24.jar
hibernate-annotations-3.4.0.GA.jar
hibernate-commons-annotations-3.3.0.ga.jar
hibernate-core-3.3.1.GA.jar
hibernate-ehcache-3.3.1.GA.jar
hibernate-entitymanager-3.4.0.GA.jar
hibernate-validator-3.1.0.GA.jar
hsqldb-1.8.0.7.jar
itext-1.4.8.jar
jasperreports-3.1.2.jar
javassist-3.8.0.GA.jar
jcommon-1.0.12.jar
jdtcore-3.2.0.v_658.jar
jfreechart-1.0.9.jar
jms-1.1.jar
jmxri-1.2.1.jar
jmxtools-1.2.1.jar
json-20080701.jar
jta-1.1.jar
junit-3.8.1.jar
log4j-1.2.15.jar
mail-1.4.jar
mysql-connector-java-5.1.6.jar
persistence-api-1.0.jar
slf4j-api-1.5.6.jar
slf4j-log4j12-1.5.6.jar
spring-2.5.6.jar
testng-5.8-jdk15.jar
xml-apis-1.3.02.jar

Hope it helops you

Greetings
Albert

john hedden
July 11, 2009, 4:03 AM

@Albert

you are correct. make sure core is first in classpath. at least it worked for me.

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.1.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>3.1.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>3.3.0.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<version>3.3.1.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
<version>3.0.0.GA</version>
</dependency>

Assignee

Unassigned

Reporter

Juergen Zimmermann

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Fix versions

Affects versions

Priority

Major
Configure