views:

435

answers:

2

I am running several webapps on Jetty 6 through Apache. They are set to hot deploy using .xml files in the contexts/ directory. Those .xml files simply define WebAppContext instances and tell them where to look for a WAR file. `touch'-ing their contexts/.xml files picks up changes to JSPs defined in the relavnt WAR file, which is great.

The problem is that changes to the JARs contained in the WAR file's WEB-INF/lib folder are not picked up. I assume that this is because these JARs are cached somewhere. That assumption is based on the fact that restarting Jetty picks up the changes.

So, the question is: Is it possible to turn off this caching behavior or in some other way get WebAppContext instances to pick up library changes? If so, how?

A: 

You need to set the scanInterval property to a number larger than zero.

See more here

David Rabinowitz
Yes the default scanInterval for the contexts/ directory is already set to 5. Hot deployment works correctly right now, my problem is that only changes to JSPs are picked up, not changes to .jar files, such as those in WEB-INF/lib.
pavel.vodenski
A: 

JBoss hot deploy scanning doesn't check the lib folder:

http://community.jboss.org/wiki/HotDeployLibDirectory

Not sure if Jetty has the same behaviour, but, you could try moving one of your jars into the same folder as one of your jsps to see if this is the case.

If that's not an option then this might help:

http://www.jroller.com/larrywilliams/entry/jetty%5Fhot%5Fdeploy

Scobal
I'm not going to test it out, but this sounds like a plausible solution.Another idea is to bring in the dependency .jars through their sources rather than as a built unit. Anyway, the pain of having to restart on library changes isn't huge, or shouldn't be; if you're designing your webapp correctly, library changes should be testable independent of the webapp front-end and thus not necessitate a server restart or hot-deployment anyway.
pavel.vodenski