You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/12/18 09:43:18 UTC

DO NOT REPLY [Bug 25615] New: - WebApp Classloader can't load GenericPrincipal

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25615>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25615

WebApp Classloader can't load GenericPrincipal

           Summary: WebApp Classloader can't load GenericPrincipal
           Product: Tomcat 4
           Version: Unknown
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Unknown
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: juergen.link1@gmx.de


We use a custom Realm (MyRealm) with a custom Principal Class MyPrincipal.
MyPrincipal extends org.apache.catalina.realm.GenericPrincipal and additionally
implements a custom Interface MyId.
Thus, we placed myJar.jar (the jar containing both classes) in the server/lib 
directory.
The authentication works, the WebApp call to request.getUserPrincipal() returns 
an object that is of class MyPrincipal (confirmed via 
myPrincipalInstance.getClass() ).
We then try to cast myPrincipalInstance to the Interface MyId which causes
a class cast exception.
Exploring the error reveals that the WebApp class loader could not load the 
class org.apache.catalina.realm.GenericPrincipal .
We tried the following workarounds:
1. Modify the class MyPrincipal not to extend 
org.apache.catalina.realm.GenericPrincipal, but implement the two interfaces 
java.security.Principal und MyId -> this causes a complete failure of Tomcat's 
authentication.
2. Place the jar myJar.jar in the common/lib dir -> Tomcat isn't able to load 
the class MyRealm on startup.

I assume custom Principal are supposed to work in Tomcat.
Am I doing wrong?

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org