wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes  Hibernate annotations gives me a NoSuchMethodError exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark " Hibernate annotations gives me a NoSuchMethodError exception" Watch " Hibernate annotations gives me a NoSuchMethodError exception" New topic
Author

Hibernate annotations gives me a NoSuchMethodError exception

venkatesh babu
Greenhorn

Joined: Sep 20, 2008
Posts: 6
Hi

I am using the latest version of hibernate

hibernate-distribution-3.3.1 GA

hibernate-annotations-3.4.0 GA

hibernate-tools-3.2.2 Beta 1


I have annotated java entity files that i have mapped in my hibernate.cfg.xml as follows..




My project compiles fine, but when i run the project, i get the following error..




My util class is something like this..



Could some one please tell me whats wrong with this and why i am getting the above exception?? Thanks for your help
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Do you have all the correct jars in your classpath when running it? and it is using the same Java version. Maybe you have the Java compiler in one version and java in another.

do

java -version

and

javac -version

do they both show the same version

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Are you using a source code management tool?

Make sure the files are not locked or read only. I've seen that cause method not founds before, curiously.

And make sure you're using 3.4 of Annotations in test, build and runtime. 3.4 was just released. It wouldn't surprise me if you've got some 3.3.1 annotation jar files hanging around.

-Cameron McKenzie
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Hibernate annotations gives me a NoSuchMethodError exception