Link to home
Start Free TrialLog in
Avatar of LeanMoreTryMore
LeanMoreTryMore

asked on

Hibernate problem - No CurrentSessionContext configured

An error, "No CurrentSessionContext configured",  occured while executing the following method


Public static Session currentSession() {
try {
   System.out.println("HibernateUtil.currentSession() - start");
   return getSessionFactory().getCurrentSession();
} catch (HibernateException ex) {
   System.out.println("HibernateUtil.currentSession() - failed due to " + ex);
   throw ex;
   }
}

I got the hibernate.cfg.xml file which resides in the Hibernate Home folder.
I have been trying for half an hour with no success.

Anyone who has any idea how to tackle this prblem, please advise.

Avatar of Kannan Ekanath
Kannan Ekanath
Flag of United Kingdom of Great Britain and Northern Ireland image

What is ur configuration file.

How are you starting the application up?
ASKER CERTIFIED SOLUTION
Avatar of novicer
novicer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial