tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sathija Pavuluri" <>
Subject Retrieving tomcat realm from org.apache.catalina.Server object
Date Fri, 13 Oct 2006 15:21:01 GMT

I would like to retrieve the tomcat realm object from the Server object.
Below is the code snippet I use ...


Server server = ServerFactory.getServer();
Service service = server.findService("Catalina");
Engine engine = (Engine) service.getContainer();

Host host = (Host) engine.findChild(engine.getDefaultHost());
Context context = (Context) host.findChild("enetaware");
Realm realm = context.getRealm();

But at line 2 here server.findService returns a null.
In fact, server.findServices() always returns an empty array of services.
But my server.xml does define a Catalina service.

Other methods like server.getGlobalNamingResources() do return some info but not

I gave privileged access to my webapp as well.

Can someone shed some light on this behavior?


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message