Tuesday, October 20, 2009

Vanishing Eclipse CVS Decorations

I'm not sure what I installed or changed but for the past week my CVS "Label Decorations" in eclipse have gone missing - driving my almost insane since I have to switch to the synchronization view to see what I've done to the code. It took me a while just to figure out that they're called "Label Decorations" and there are a whole bunch of options under Preferences->Team->CVS->Label Decorations. I toyed with this to no avail. But finally I've figure out the trouble. Something had turned off the "Label Decorations" in the Package view. To solve the problem:
1) Select a project in the package view
2) Choose Window->Preferences
3) Look at General->Appearance->Label Decorations
4) Make sure that CVS is checked

Thursday, October 8, 2009

Tomcat Locked Resources

So I spent a few minutes the other day setting up a nice ant task to deploy my war file to Tomcat automatically. It worked the first time, but not the second time - because Tomcat still had some jars locked down in the WEB-INF directory. Today I finally figured out a solution to the problem. One can add this the following attributes to the META-INF/context.xml file to solve the trouble...

antiJARLocking
If true, the Tomcat classloader will take extra measures to avoid JAR file locking when resources are accessed inside JARs through URLs. This will impact startup time of applications, but could prove to be useful on platforms or configurations where file locking can occur. If not specified, the default value is false.

antiResourceLocking
If true, Tomcat will prevent any file locking. This will significantly impact startup time of applications, but allows full webapp hot deploy and undeploy on platforms or configurations where file locking can occur. If not specified, the default value is false.
Please note that setting this to true has some side effects, including the disabling of JSP reloading in a running server: see Bugzilla 37668.
Please note that setting this flag to true in applications that are outside the appBase for the Host (the webapps directory by default) will cause the application to be deleted on Tomcat shutdown. You probably don't want to do this, so think twice before setting antiResourceLocking=true on a webapp that's outside the appBase for its Host.

the above from http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

In a minimal sense:
<Context antiJARLocking="true" antiResourceLocking="true" />

is all you need.