You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Bongiorno.Christian" <Bo...@ensco.com> on 2001/12/18 02:08:38 UTC

ClassCastException, custom Realm, and ClassLoading

We have a custom realm written. Works great until I try to downcast the principal returned from an authentication so that I can call a specific method. Upon investigation (everyone knows this, I know) the error is due to the fact that TC has multiple class loaders and this particular class was loaded from 2 places. I read the class-loader-howto.html that explains the hierarchy. So, I go to put the Jar containing my realm and my subclass of java.security.Principal into the lib directory and I get a ClassNotFound exception for  org.apache.catalina.realm.RealmBase

When I put the jar in common/lib I get ClassNotFound exception for  com.ensco.nt_authentication.Ensco_NT_Realm

Putting the jar in two places gives the CCE. I have tried putting the jar in all 3 lib directories individually and I get the above chicken-and-egg situation. if I override the entire classpath and specify every jar on the commandline it will work. this is obviously not the best approach. So, then, where do I need to put things to make this work? 

Chris

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>