You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ma...@plangroup.it on 2002/02/10 23:08:04 UTC
ClassLoader problem?
Tomcat 4.0.1 - Linux - sun jdk 1.3.1_02
I'm developing a web app where users are authenticated on a Oracle database.
I have implemented a personal Realm class called (for example) MyRealm. This class
create an instance of a class MyPrincipal (implementing java.security.Principal) and
store some logon information on it.
When I call request.getUserPrincipal() in my servlets/JSPs and try to cast to
MyPrincipal, I obtain a ClassCastException. The Principal instance returned from
request.getUserPrincipal() is really a MyPrincipal instance (as getClass().getName()
says).
The JAR file containing MyPrincipal definition is located both
$CATALINA_BASE/common/lib and $CATALINA_HOME/server/lib, and naturally the
two files are identical.
I suppose it is a problem due to two different classloaders
(org.apache.catalina.loader.StandardClassLoader and
org.apache.jasper.servlet.JasperLoader).
How can I solve this problem?
Thanks, Marco
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>