Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2007

Tip: Looking for answers? Try searching our database.

Tomcat, reloading context

Thread view: 
Drazen Gemic - 21 Nov 2007 16:11 GMT
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
Manish Pandit - 21 Nov 2007 18:11 GMT
> 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
[quoted text clipped - 3 lines]
>
> DG

You might want to download Tomcat's source, and drill down the
manager's API to see how it invokes the reloader.

-cheers,
Manish
Manish Pandit - 21 Nov 2007 18:14 GMT
> 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
[quoted text clipped - 3 lines]
>
> 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
Manish Pandit - 21 Nov 2007 18:14 GMT
> 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
[quoted text clipped - 3 lines]
>
> 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
Drazen Gemic - 21 Nov 2007 20:19 GMT
> > 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
[quoted text clipped - 9 lines]
> 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
Arne Vajhøj - 23 Nov 2007 03:49 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.