I'm running Tomcat 7.0.19 with IntelliJ IDEA IDE. I'm using the new Servlet
3.0 feature that allows webapp resources to be served from within JARs'
META-INF/resources directory. This technique is working fine, however I
would like to be able to "hot swap" these resources at runtime in a local
development environment using my IDE. That is not working.

In my scenario, I have two artifacts in IDEA. One is a webapp that produces
a WAR (I'm deploying this as an exploded war to tomcat). The other is a JAR
with some JavaScript / CSS / HTML and JSP resources. The webapp includes the
JAR. When IDEA deploys the webapp it compiles creates the JAR from the
second artifact and plops it in the exploded webapp's lib folder. It then
starts up tomcat and points it to the exploded webapp folder. This works
perfectly. Then, while tomcat is running, I make a change to one of the
resources in the JAR and tell IDEA to update classes and resources. I can
see on disk that IDEA puts a new version of the JAR in the libs folder. The
JAR has an new modified date. If I unzip the JAR, I can see that it contains
my changes. However tomcat is still serving up the old version of the file.

The same thing happens whether I update a file or add a new file. The
behavior is also the same for both static files and JSPs.

Note that updates work fine for resources in the webapps root directory,
it's only the resources inside JARs that don't reload. Also note that the
updates do come through fine once I restart tomcat or reload the webapp;
however I would very much like to avoid having to do that.

Is this a Tomcat bug, missing feature, or is there something IDEA is doing
incorrectly?

Thanks.

--

David Wolverton | Vodori Inc | david.wolver...@vodori.com | (w) 312.324.3963
| (c) 773.571.3750

Reply via email to