Ok, found a possibly related error in catalina.out:
Code:
com.opensymphony.user.util.ConfigLoader load
SEVERE: Exception
java.lang.NoClassDefFoundError: net/sf/hibernate/HibernateException
at com.opensymphony.user.provider.hibernate.HibernateBaseProvider.init(HibernateBaseProvider.java:80)
at com.opensymphony.user.util.ConfigLoader.addProvider(ConfigLoader.java:123)
at com.opensymphony.user.util.ConfigLoader.access$100(ConfigLoader.java:37)
at com.opensymphony.user.util.ConfigLoader$ConfigHandler.endElement(ConfigLoader.java:154)
at
...
this is the error that the servlet throws up:
Code:
java.lang.RuntimeException: net/sf/hibernate/HibernateException
com.opensymphony.user.util.ConfigLoader.load(ConfigLoader.java:74)
com.opensymphony.user.UserManager.(UserManager.java:103)
com.opensymphony.user.UserManager.(UserManager.java:58)
org.mathesis.test.OSUserTest.doGet(OSUserTest.java:35)
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
I've got hibernate.jar in my WEB-INF/lib directory...
This is the servlet code:
Code:
/*
* Created on 29-sep-2003
*
* To change the template for this generated file go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
package org.mathesis.test;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Collection;
import java.util.Iterator;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.opensymphony.user.DuplicateEntityException;
import com.opensymphony.user.ImmutableException;
import com.opensymphony.user.User;
import com.opensymphony.user.UserManager;
import com.opensymphony.user.provider.CredentialsProvider;
/**
* @author iljahehenkamp
*
* To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
public class OSUserTest extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
UserManager um = new UserManager();
PrintWriter out = response.getWriter();
Collection credentialProviders = null;
try
{
credentialProviders = um.getCredentialsProviders();
for (Iterator iterator = credentialProviders.iterator(); iterator.hasNext();)
{
CredentialsProvider provider = (CredentialsProvider) iterator.next();
}
}
catch (NullPointerException e)
{
// TODO Auto-generated catch block
e.printStackTrace(out);
}
try
{
User u = um.createUser("jan wandelaar");
}
catch (DuplicateEntityException e)
{
// TODO Auto-generated catch block
e.printStackTrace(out);
}
catch (ImmutableException e)
{
// TODO Auto-generated catch block
e.printStackTrace(out);
}
catch (NullPointerException e)
{
// TODO Auto-generated catch block
e.printStackTrace(out);
}
catch (RuntimeException e)
{
// TODO Auto-generated catch block
e.printStackTrace(out);
}
catch (Exception e)
{
e.printStackTrace(out);
}
}
}