Tomcat, reloading context

D

Drazen Gemic

I'd like to reload Tomcat context (application) from Java code, like
it is done via Manager application. I would not like to do it using
corresponding Manage URL. I guess that it has something to do with a
specific classloader. Can someone point me in right direction,
please ?

DG
 
M

Manish Pandit

I'd like to reload Tomcat context (application) from Java code, like
it is done via Manager application. I would not like to do it using
corresponding Manage URL. I guess that it has something to do with a
specific classloader. Can someone point me in right direction,
please ?

DG

On another thought, you can also use Tomcat's JMX to invoke the MBean
methods on the context object. Reload should be one of the methods
accessible via this MBean. The MBean's methods can also be invoked
programatically. Look up JMX API usage, as well as see if you can
access the MBean via jconsole.

-cheers,
Manish
 
M

Manish Pandit

I'd like to reload Tomcat context (application) from Java code, like
it is done via Manager application. I would not like to do it using
corresponding Manage URL. I guess that it has something to do with a
specific classloader. Can someone point me in right direction,
please ?

DG

On another thought, you can also use Tomcat's JMX to invoke the MBean
methods on the context object. Reload should be one of the methods
accessible via this MBean. The MBean's methods can also be invoked
programatically. Look up JMX API usage, as well as see if you can
access the MBean via jconsole.

-cheers,
Manish
 
D

Drazen Gemic

On another thought, you can also use Tomcat's JMX to invoke the MBean
methods on the context object. Reload should be one of the methods
accessible via this MBean. The MBean's methods can also be invoked
programatically. Look up JMX API usage, as well as see if you can
access the MBean via jconsole.

I've found Tomcat specific API, and class org.catalina.Context which
has method reload(),
which I need. The problem is that I don't see any way to obtain the
reference to current Context,
or any other particular Context. That Context object does not seem to
have anything with ServletContext
..

I could find the cuurent context by name, but I need a reference to a
top level Container that contains all Host and Context objects.

Drilling down the source code may not be a good idea, because it could
change in next release.

I'll try to find some Tomcat specific mailing list.

DG
 
A

Arne Vajhøj

Drazen said:
I've found Tomcat specific API, and class org.catalina.Context which
has method reload(),
which I need. The problem is that I don't see any way to obtain the
reference to current Context,
or any other particular Context. That Context object does not seem to
have anything with ServletContext

Try look at the source for the Tomcat ant tasks.

The reload task does what you want.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
VetaMcRae
Top