Hi 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.
Quote:
[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..
Code:
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:
Any Suggestion is Very Much Appreciated and thanks In Advance
JD
[/quote]