Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate annotations gives me a NoSuchMethodError exception

 
venkatesh babu
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic