Hi Everyone We hope you have seen our hibernate tutorials if not click the hibernate tab,Here i am going to give you

Some of the Common Errors in Hibernate

Which occurred during the compiling and running of hibernate.

java.lang.NoClassDefFoundError: javax/transaction/Synchronization at org.hibernate.impl.SessionFactoryImpl.buildCurrentSessionContext(Sess
ionFactoryImpl.java:1036)
Click to view the solution

Exception in thread “main” java.lang.ExceptionInInitializerError
atTestClient.createHoney(TestClient.java:82)atTestClient.main(TestClient.java:25)Caused by: org.hibernate.HibernateException: /hibernate.cfg.xml not found at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:170)
Click to view the solution

Exception in thread “main” java.lang.ExceptionInInitializerError
at quickstart.HibernateUtil.(HibernateUtil.java:26)
at h.main(h.java:16)Caused by: org.hibernate.HibernateException: Could not find datasource at org.hibernate.connection.DatasourceConnectionProvider.configure(Datas
ourceConnectionProvider.java:79)
Click to view the solution

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment
).log4j:WARN Please initialize the log4j system properly.
Click to view the Solution

JTA(Java Transaction)

For this error you need to adjust the class path for compiling that is “jta.jar” is missing put jta.jar in lib folder to solve this problem

Back to Top

Hibernate.cf.xml

For this error you need to check whether your put hibernate.cfg.xml is in root directory or check cfg file for any misspelling or missing statements
Back to Top


Begin transaction

For this error check that transaction has been created create transaction is not begin ex:tx = session.beginTransaction();
session.save(honey);
tx.commit();


log4j.prperties

This is actually not an error it shows because it has started log4j.properties file nothing worry about this warningBack to top

If your error is not addresses here Contact us CLICK HERE