• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Restarting webapplication from servlet/jsp?

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I would appreciate your help concerning the following problem:

I have an application running on Tomcat.
After uploading some xml-files I want to restart the application which uses these xml-files.

Usually I can do that with the Tomcat Manager.
Unfortunately I can�t do that in that case (www.myproject.com sends me to the webapp-director => index.html, I don�t have access to the tomcat root page).

So I need a servlet/jsp that does the following thing:
WebApp mywebapp = Tomcat.getWebApp("mywebapp");
mywebapp.restart();

Or can I transfer the existing tomcat manager somehow into my webapplication?

Or can I write a second application that starts/stop/restarts my webapplication?

Thanks for your advice,
Robert.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seems to me you don't really need to restart the application, you just need to re-initialize the part that depends on the XML, right?
I have an on-line test engine that uses XML for configuration and for defining the test questions. Naturally I don't want to restart the whole thing (which is likely to have people using it) when one test script is changed.
The solution I used is to have a password protected request that can perform various management functions. One of these functions is to build a new set of tests from the XML files. The new set replaces the old set in a synchronized operation, and existing users keep their own copies of the test they are working on. As the existing users quit, those outdated copies are eventually garbage collected.
Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic