Wednesday, August 25, 2010

Initial SessionFactory creation failed.org.hibernate.AnnotationException: java.lang.NoSuchMethodException

When you have the default libraries provided by the Hibernate 3.5 (hibernate-annotations.jar)and also have the ebj3-persistence.jar to support the annotation feature, you will be end up with the following exception on runtime
Initial SessionFactory creation failed.org.hibernate.AnnotationException: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.(java.lang.Class, java.util.ResourceBundle, org.hibernate.validator.MessageInterpolator, java.util.Map, org.hibernate.annotations.common.reflection.ReflectionManager)
This is because of the incompatible types, if you are using the EJB based Annotations feature just, remove the hibernate-annotations.jar from your library. This will resolve the above runtime exceptions.

1 comment: