Is the Hibernate jar in the classpath as well? Or did you perhaps decide to put the Hibernate jar into the JRE's extensions directory?
Joined: Jul 02, 2008
Hi, The Hibernate classes are also getting included in my Jar. Why are you asking about that, though? The exception is complaining about one of my classes and in the stack trace, one of the Hibernate classes is successfully invoked. - Dave
Well AnnotationConfiguration is deprecated. You should be using Configuration now.
Are you sure you are using javax.persistence.Entity instead of org.hibernate.annotation.Entity? If you are using the hibernate one by accident the AnnotationConfiguration class will ignore it. To test this you can try adding the class pragmatically instead and see what happens.
Also note that if you have a file called hibernate.cfg.xml on the root of classpath you do not need to specify it explicitly, as this is the default.