Marsellus Wallace
Marsellus Wallace

Reputation: 18611

Changing xml/property files after war deployment without restarting Tomcat 7

In my web-app (maven, spring) I have the following project structure:

MyWebApp
--src
  --main
    --java
      ...
    --resources
      --spring
        spring_stuff.xml
        ...
      mywebapp.properties
      mylogs.xml
    --webapp
      --spring
        --appServlet
          servlet-context.xml
      ...
pom.xml

One I deploy the WAR file to a Tomcat server using the Manager App, the war gets unpacked and the files above are available in the webapp folder. However, if I am not allowed to modify the files since they are 'in-use' by the web server. What can I do differently to be able to modify the property files while Tomcat is running and without having to restart it?

Is there a way (maybe in maven/spring) to set up a project so that different properties are enabled/disabled depending on where the WAR gets deployed?

Upvotes: 2

Views: 1174

Answers (2)

Ashish
Ashish

Reputation: 3652

Looks like an old question but the problem statement in this question is perfect case of the usage of JMX which is a web based console to update message beans without restarting the server. There is JConsole as well but that is not web based.

Upvotes: 0

Dan Ciborowski - MSFT
Dan Ciborowski - MSFT

Reputation: 7247

I use a program called Jrebel

It checks for code changes, and on compiles deploys war automatically without having to restart tomcat.

Upvotes: 1

Related Questions