You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "andrew@capecomputing.com" <an...@capecomputing.com> on 2003/03/12 23:26:57 UTC

userDatabase / classloader question

hi all,

trying to reference the userDatabase from my application, but get a Class
CastException. Here is my code:

javax.naming.Context ctx = new InitialContext();
Object ud = ctx.lookup("java:comp/env/userDatabase");
//System.out.println(ud.getClass().getClassLoader());
UserDatabase usrd = (UserDatabase) ud;



and i have the <ResourceLink> set up in server.xml.


i got a ClassCastException when trying to cast it to UserDatabase, and
apparently that's because it was loaded from the Catalina classloader and
is not visible from my application classloader.

so just wondering if there's something else i need to do before i can use
the UserDatabase, or is it not meant to be used?

thanks

andrew

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .



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