tags:

views:

145

answers:

1

I have a spring application that uses JBoss Drools 5. It works fine except for when I attempt to redeploy (i.e. hot deploy) the application after I make a change during development. It appears that tomcat keeps a lock on 2 drools jar files, drools-compiler-5.0.1.jar and drools-core-5.0.1.jar. Since they can't be deleted the new war file does not get deployed. If my application does not make any Drools logic calls, then the hot deploy works.

Does anyone have any ideas?

+1  A: 

I wouldn't know about drools specifics, but chances are, Tomcat classloader couldn't fully unload your app. Similar problem for commons-logging is explained here: http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java

As a workaround, you can try using antiResourceLocking="true" in your $tomcat_home/conf/context.xml. This should at least help to release the locks. For more details, consult http://tomcat.apache.org/tomcat-6.0-doc/config/context.html.

mindas
Thanks, that did the trick.
FrankL
Similar problem exist with `mail.jar` from JavaMail by the way. It will "hang" whenever you've sent at least one mail. The underlying problem is caused by the operating system. Windows is known in this.
BalusC
@FrankL - if this helped, don't forget to mark the answer as accepted :)@BalusC - I think Windows cannot be blamed in this case just because Java process holds the file lock. Yes, I much rather prefer Linux-style locking, but the root problem here is Java (either particular library or language), and not OS.
mindas
Thanks for the answer and input on using this forum. I am new to it, but will use it more in the future.
FrankL