Hibernate Troubleshooting:

Here are some common runtime errors and their possible solution:

org.hibernate.HibernateException: No CurrentSessionContext configured

You haven't configured the current_session_context_class property. Add this to your hibernate.cfg.xml:
 <property name="current_session_context_class">thread</property>

org.hibernate.MappingException: Unknown entity: sample.hibernate.Person

It's likely that you have not added (or added with wrong Classname/namespace) the Class Mapping file.

Could not parse mapping document from resource sample/hibernate/Person.hbm.xml
Exception in thread "main" java.lang.ExceptionInInitializerError

Maybe you have forgot to add the DTD information at the top of your Person.hbm.xml

Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

You are missing the Simply Logging Facade util. Download it http://www.slf4j.org/dist/slf4j-1.5.2.zip and then add either log4j or JDK14 implementation.

0
0
0
s2smodern