Hi,
I posted this morning a message describing a ClassNotFoundException (see below) which appears in my application as soon as I deploy to tomcat...but the application works fine as stand alone.
Now I found out the reason and the reason is really astonishing: the results within my list are produced from the following ClassLoader:
sun.misc.Launcher$AppClassLoader@e80a59
...and the User object I use for casting references the tomcat ClassLoader which is of course different!
Now I got the reason for my problem the resulting question is: how can I solve this? And this is my question to all of You: has anybody experience with this ClassLoader issue or can anyone tell me how to change the tomcat or hibernate ClassLoader?
Thanx in advance, Flo!
public boolean login(String username,String password)
throws Exception
{
// check whether username and password match
util.hibernate.entity.User user = null;
Session session = SessionUtil.getCurrentSession();
Criteria criteria = session.createCriteria(util.hibernate.entity.User.class);
List userList = criteria.list();
for (int i=0; i<userList.size(); i++)
{
user = (util.hibernate.entity.User)userList.get(i);
}
return false;
}
|