//code
Object o = ic.lookup("java:comp/env/users");
System.out.println(o.getClass().getName()); // prints :
"org.apache.catalina.users.MemoryUserDatabase"
doing instanceof tests on the returned object for MemoryUserDatabase &
UserDatabase all fail, even though in debug that's clearly what it
identifies as.
could this be a security manager thing? I notice that in the tomcat
manager deployment descriptor it has privileged="true" in the Context
tag. Are only privileged applications allowed access to the
UserDatabase? (this would make sense as you could enumerate all users &
passwords...)
Gregor Schneider wrote:
InitialContext.lookup() gives you a simple object:
so change your code to
Context ic = new InitialContext();
Object o = ic.lookup("java:comp/env/users");
set a breakpoint and see, what type of object you're getting back.
hth
gregor
--
Matthew Kerle
IT Consultant
Canberra, Australia
Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]