Because of the way that file system locking works on Windows
platforms, hot redeployment of a Web application on Windows can sometimes
fail. Hot redeployment may also fail when you stop or undeploy a Web
application on Windows. The problem can occur when you use the HQ user
interface or the tcsadmin command-line
interface.
To resolve the problem:
Update the CATALINA_BASE/conf/context.xml
file of the tc Runtime instance and set the following two attributes
of the <Context> element to
true:
antiJARLocking: When set to
true, the Tomcat classloader takes extra
measures to avoid JAR file locking when resources are accessed
inside JARs through URLs. This action affects the startup time of
applications, but is useful on platforms (such as Windows) or
configurations where file locking can occur.
antiResourceLocking: When set to
true, Tomcat prevents any file locking. This
action affects startup time of applications significantly, but
allows full Web application hot redeploy on platforms (such as
Windows) or configurations where file locking can occur.
The following context.xml snippet shows how
to specify the attributes; only the relevant part of the file is
shown:
<Context antiJARLocking="true" antiResourceLocking="true"> <WatchedResource>...
Restart the tc Runtime instance for the change to take effect.
Setting antiJARLocking and
antiResourceLocking to true forces
tc Runtime to copy files rather than read them in place. Also, if you try
to copy in a new .jsp file directly, tc Runtime does
not pick it up.
If you prefer, you can set these two properties in the
context.xml file of the application itself rather than
in the context.xml file for the entire tc Runtime
instance.
For more information and warnings about configuring the
context.xml file, see The
Context Container.