0

My task involves deploying a Java web application into a Tomcat 6.0.35 instance running on Debian Squeeze. As such, Tomcat is installed from package sources and the web application is deployed from a custom .deb package that puts the .war file into a directory below /opt and registers it with Tomcat by dropping a context XML (let's call it my-app.xml) into /etc/tomcat6/Catalina/localhost/. This works fine for the initial .deb install where the application is picked up by Tomcat's auto deployment mechanism and unpacked into /var/lib/tomcat6/webapps/.

When re-installing a newer version of the .deb, Tomcat will not update the application, though. It will only detect a change if I manually execute a

touch /etc/tomcat6/Catalina/localhost/my-app.xml

Even restarting Tomcat without touching my-app.xml has no effect.

my-app.xml looks like this:

<Context path="/my-app" docBase="/opt/my-app/my-app.war">
    <WatchedResource>/opt/my-app/my-app.war</WatchedResource>
</Context>

IMHO, this should watch for changes of the .war (which changes when I install the updated .deb).

Autodeploy is turned on in server.xml.

Any ideas?

1 Answer 1

2

Put the touch line into the post-install script of your deb file

1
  • I would have hoped to be able to solve this by configuration, but sure, this will do as a workaround. Jun 21, 2012 at 11:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .