tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rickard Öberg <>
Subject Re: Accessing Tomcat classes
Date Wed, 21 May 2003 07:01:46 GMT
Bill Barker wrote:

> 1)  Assuming that you trust all of your webapps (e.g. you are not a hosting
> service), then probably the easiest is to move the JMX jars to common/lib,
> and access everything from JMX.

If I look something up from JMX, won't I get a ClassCastException when I 
try to cast it to the Tomcat classes? Also, where do I put catalina.jar?

> 2) Otherwise, use the ServerLifecyleListener as a model as to how to
> propogate your Listener throughout the application, and stick everything
> that you need into a Context attribute that your servlet can look up.

The problem is that the ONLY code I have is stuff in a WAR file. I.e. 
there's nothing that can "stick" something into anything.

What I want to do is:
*) have a ServletListener access the Host
*) get deployed contexts from there, and register for changes

Is this possible? It *should* be *if* I can get both Tomcat and my WAR 
classes to access the same catalina.jar from some classloader. Having 
duplicates is no good, because then I'll get ClassCastException's.


Rickard Öberg

Got blog? I do.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message