Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Want to reload the web.xml without restarting the server

In production box i want to change the web.xml in a J2EE web application but i don't want to restart the server or the application because this can create problem for lot of online users. Suggest a way so that my web.xml changes should reflect in the web app.

like image 251
BOSS Avatar asked Mar 23 '11 06:03

BOSS


2 Answers

As far as I know, there's no way of getting around restarting the server if you need it to read the new web.xml, because the config file is read when the server starts (ie. think about it being processed only on servlet init()).

If someone can point out how we can hot deploy config file, I would like to know too though.

like image 158
TS- Avatar answered Sep 21 '22 09:09

TS-


Just to throw an idea out... You could embed your webserver (like embedded tomcat) and programmaticly restart it based upon some event. However, there will be a period of time where the webserver is down. Maybe create a new embedded tomcat instance using your new web.xml. You can now direct traffic to the new embedded webserver while you shutdown the old one.

like image 27
jeverest Avatar answered Sep 18 '22 09:09

jeverest