- This topic has 2 replies, 1 voice, and was last updated 19 years, 3 months ago by jdsrinivas.
-
AuthorPosts
-
jdsrinivasMemberHi There,
My Application is unable to find the hibernate.cfg.xml file and throwing the following exception when i deployed my application in Websphere 5.1 AS.
//
[9/6/05 12:43:44:913 EDT] 416e479 Configuration I net.sf.hibernate.cfg.Configuration configuring from resource: /hibernate.cfg.xml
[9/6/05 12:43:44:913 EDT] 416e479 Configuration I net.sf.hibernate.cfg.Configuration Configuration resource: /hibernate.cfg.xml
[9/6/05 12:43:44:913 EDT] 416e479 Configuration W net.sf.hibernate.cfg.Configuration /hibernate.cfg.xml not found
[9/6/05 12:43:44:929 EDT] 416e479 RequestProces W org.apache.struts.action.RequestProcessor Unhandled Exception thrown: class java.lang.NullPointerException
[9/6/05 12:43:44:929 EDT] 416e479 WebGroup E SRVE0026E: [Servlet Error]-[]: java.lang.NullPointerException
at us.ny.state.otda.dcse.commons.persistence.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:59)
at us.ny.state.otda.dcse.login.persistence.LoginPersister.getParentRole(LoginPersister.java:64)//
It works fine when i ran it locally by using test case..
Here is the code for currentSession method in my HibernateSessionFactory..
public static Session currentSession() throws HibernateException { Session session = (Session) threadLocal.get(); if (session == null) { if (sessionFactory == null) { try { System.out.println("1:"); cfg.configure(CONFIG_FILE_LOCATION); System.out.println("2:"); sessionFactory = cfg.buildSessionFactory(); System.out.println("3:"); } catch (Exception e) { System.err.println("%%%% Error Creating SessionFactory %%%%"); e.printStackTrace(); } } session = sessionFactory.openSession(); threadLocal.set(session); } return session; }
Its printing 1: and generating error in my log file..Its not printing 2:
My Co-worker is working on same application ..he doesn’t have any problem..
Any Suggestion is Very Much Appreciated and thanks In Advance
JD
jdsrinivasMemberExact problem is BOLD letters
[9/6/05 12:43:44:913 EDT] 416e479 Configuration I net.sf.hibernate.cfg.Configuration configuring from resource: /hibernate.cfg.xml
[9/6/05 12:43:44:913 EDT] 416e479 Configuration I net.sf.hibernate.cfg.Configuration Configuration resource: /hibernate.cfg.xml
[9/6/05 12:43:44:913 EDT] 416e479 Configuration W net.sf.hibernate.cfg.Configuration /hibernate.cfg.xml not found
[9/6/05 12:43:44:929 EDT] 416e479 RequestProces W org.apache.struts.action.RequestProcessor Unhandled Exception thrown: class java.lang.NullPointerException
[9/6/05 12:43:44:929 EDT] 416e479 WebGroup E SRVE0026E: [Servlet Error]-[]: java.lang.NullPointerException
at us.ny.state.otda.dcse.commons.persistence.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:59)
at us.ny.state.otda.dcse.login.persistence.LoginPersister.getParentRole(LoginPersister.java:64)
jdsrinivasMemberHere is the code for declaration of CONFIG_FILE_LOCATION
private static String CONFIG_FILE_LOCATION = "/hibernate.cfg.xml";
-
AuthorPosts