I am running an application on JBoss server which is developed using struts2 & Hibernate. But I am facing a problem in my getEmployee method of LoginDAOImpl class.The code is as below:-
@SuppressWarnings("unchecked")
public List<UserView> getEmployee(String empId) {
Session session = null;
List<UserView> list = null;
try {
System.out.println("in LoginDAOImpl getEmployee : 1 ");
session = HibernateSessionFactory.getSession();
System.out.println("in LoginDAOImpl getEmployee : 2 " + session);
String str = "from UserView where empId='" + empId + "'";
list = session.createQuery(str).list();
System.out.println("LoginDAOImpl.getEmployee()::" + empId);
} catch (HibernateException e) {
e.printStackTrace();
} finally {
HibernateSessionFactory.closeSession();
}
return list;
}
On Console Iam getting "in LoginDAOImpl getEmployee : 1 " but i am not getting "in LoginDAOImpl getEmployee : 2 ".That means it is not able to find Hibernatesessionfactory class.But I have included Hibernatesessionfactory in my path. I have included jars for Hibernate :- hibernate3.jar,hibernate-annotations-3.2.1.ga.jar,hibernate-annotations.jar,hibernate-commons-annotations.jar,hibernate-entitymanager.jar,hibernate-valid