I recently obtained the following error:
java.lang.NoSuchMethodError: org.hibernate.event.PreInsertEvent.getSource()Lorg/hibernate/engine/SessionImplementor;
This occurred when attempting to run a test on one of my Hibernate DAO entities.
The problem started when I updated some (but not all) of my hibernate .jar libraries, to enable the use of spring-test.jar to provide access to the helper org.springframework.test.AbstractTransactionalDataSourceSpringContextTests methods.
It turns out (http://opensource.atlassian.com/projects/hibernate/browse/HV-67) that the problem was:
Method getSource from an older version of the Hibernate Core is referenced.
It is stated within the compatibility matrix that Hibernate Validator 3.1.0.CR1 is compatible only with Hibernate Core 3.3.x version(s).Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.event.PreInsertEvent.getSource()Lorg/hibernate/engine/SessionImplementor;
That is, I was using the latest Hibernate Core (3.3.x), but didn't have the most up to date Hibernate Validator. I downloaded a new hibernate-validator.jar and everything worked again.
Subscribe to:
Post Comments (Atom)
11 comments:
Thank you for posting this Glenn. This was the only post on the entire Internet that actually helped me move past the issue. For me, validator was being put onto the classpath from a project dependency before validator specific to my project. Thank you so much.
thanks, this took me away a terrible headache :)
Paolo
Thank you, Glenn this used to be a real PITA :-) ...
Cheers
Daniele
Thanks so much.
Thanks Glenn - saved me a lot of time
thks !
I spent half a day on this pb, before read your post.
Alex
Great post. Sometimes I'm amazed on how cryptic can the Hibernate messages become.
Even Though i have added the latest validator,it doesn't work.i am getting same error .please help me out .........
Dude... You removed my headache..
I just came out from nightmare.. Thanks for this post...
You.. removed my headache, Thanks for your post.
Could you please tell me what versions you used to solve the problem? I've been dealing with this problem and I can't find the way to solve it yet
These are the maven dependencies I'm using:
org.hibernate
hibernate-core
3.3.1.GA
org.hibernate
hibernate-validator
4.2.0.Final
org.hibernate
hibernate-annotations
3.4.0.GA
Kind regards.
Post a Comment