Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I need changes of xml file reflecting with out restart tomcat

 
Chintan H Patel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In my application i am using quartz as daemon process in my application. In that all configuration is through one xml file. That xml file contains the delay, time of start services etc.
Right now that parameters in xml file is static given.

But now i need to control that parameters of xml file from one GUI (one JSP) page. I am able to change the parameter of xml file from JSP but it is not reflacting.
To reflect i need to restart the tomcat server. That's i not want.

Is it possible that we change the parameters and values from xml and will reflect without restarting tomcat server ?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what would be best is that the application watches the XML file and reloads it on its own, if that is what the application requires.
you could add the file to the context watch list, but when that sees a change it would redeploy (and reload) the file but bouncing the context may not be the most elegant solution.
 
Aditya Kanitkar
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David O'Meara wrote:what would be best is that the application watches the XML file and reloads it on its own, if that is what the application requires.
you could add the file to the context watch list, but when that sees a change it would redeploy (and reload) the file but bouncing the context may not be the most elegant solution.


@David O'Meara : Should it be added into web.xml or struts-config.xml?

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have done this by code in doGet which watches for a special keyword - when found it causes a re-reading of the properties, xml, whatever configuration file and generates a HTML page stating the result. It is easy to then create a static HTML file on your own system with the required FORM or plain link.

Bill
 
Campbell Ritchie
Sheriff
Pie
Posts: 48968
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and welcome to JavaRanch
 
Alex Hurtt
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not a guru at it or anything but would this be the kind of thing JMX was designed to handle?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic