You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Rush <da...@rushtone.com> on 2007/01/09 19:57:32 UTC

Problem with auto-deploy

I'm having trouble with the auto-deploy of .war files on Tomcat 5.5.20
running on Windows 2003 Server.

When I drop a new .war file into the appropriate webapps directory,
Tomcat's finding it and trying to deploy it, but it fails.  It succeeds
in removing the old directory (that a previous auto-deployment created)
in the webapps directory, but it fails to complete the deployment with:

2007-01-09 11:21:44,859
(org.apache.catalina.startup.ContextConfig,init(),ERROR) Exception 
fixing docBase: {0}
java.util.zip.ZipException: The process cannot access the file because
it is being used by another process

and

2007-01-09 11:21:44,875
(org.apache.catalina.core.StandardContext,resourcesStart(),ERROR) Error
starting static Resources
java.lang.IllegalArgumentException: Invalid or unreadable WAR file : The
process cannot access the file because it is being used by another process

If I stop the Tomcat service and restart it (without touching the .war
file at all), Tomcat comes up fine, discovers the .war file a few
seconds later, and deploys it without a problem (thus demonstrating that
the .war file itself is fine).

Any ideas?  I have two machines that are exhibiting this same behavior,
and a third that never has this problem (using the same .war file in all
cases).  The "no problem" machine is my developmental machine running
Windows XP, and the two problematic machines are running Windows 2003
Server.

David


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Problem with auto-deploy

Posted by David Rush <da...@rushtone.com>.
I have further evidence that the problem has to do with my new .war file 
being copied in when the background processor (auto-deploy) cycle "hits" 
and tries to reload.

I've slowed the process to every 30 seconds rather than the apparent 
default of every 10 seconds (by setting backgroundProcessorDelay="30" in 
the Engine element of server.xml). 

If I target the upload of my new .war file (which takes about 25 
seconds) to start right after a background processor cycle, and it 
finishes before the next cycle, everything works fine.  The new .war 
file is deployed and works.

If I target the upload to span a background processor cycle "hit" (that 
is, the file is still copying when a cycle hits), the deployment fails.  
The old expanded directory is removed, but it is not recreated and the 
web application no longer functions.

If I subsequently upload "in between" background processor cycle hits, 
the web application will start functioning again (and gets expanded again).

It strikes me as strange that, by default, the process relies on .war 
file replacements to land cleanly in between background processor 
cycles.  Now in most cases where .war files are being copied more or 
less locally and quickly, it usually works, so I guess it's not a huge 
problem for most people.

Now to figure out a good way around this....

David

Caldarale, Charles R wrote:
>> From: david@rushtone.com [mailto:davidarush@gmail.com]
>> Subject: Problem with auto-deploy
>>
>> 2007-01-09 11:21:44,859
>> (org.apache.catalina.startup.ContextConfig,init(),ERROR)
>> Exception fixing docBase: {0}
>> java.util.zip.ZipException: The process cannot access the
>> file because it is being used by another process
>>     
>
> Look at the antiJARLocking and antiResourceLocking attributes of the
> <Context> element:
> http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>   

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Problem with auto-deploy

Posted by David Rush <da...@rushtone.com>.
Chuck:

Thanks for the tip.  I played a bit with both attributes, with no luck 
(but admittedly I don't fully understand them, so I was playing somewhat 
blind).  I was able to get different errors, but no joy.

Here's what I've since discovered....

My normal mode of operation is to copy my .war files, of significant 
size, over a non-local, relatively slow connection, which normally takes 
about 25 seconds.

When I made a test .war file, with minimal contents and small size which 
copies quickly (1 second or so), things usually work fine.

What I think may be happening is that when I start the copy, it's not 
done when the next auto-load cycle comes around (every 10 seconds).  It 
tries loading an incomplete .war file, which may be locked because it's 
not done copying.  So it gives up completely, not even trying again in 
subsequent auto-load cycles.

When I copy the small .war file, it takes about 1 second, and hits "in 
between" auto-deploy cycles (at least usually).

Hmmm.... if I set the auto-deploy cycle to a longer time frame, in 
excess of the expected file copy time, that should improve my odds.  
I'll give it a try.

David


Caldarale, Charles R wrote:
>> From: david@rushtone.com [mailto:davidarush@gmail.com]
>> Subject: Problem with auto-deploy
>>
>> 2007-01-09 11:21:44,859
>> (org.apache.catalina.startup.ContextConfig,init(),ERROR)
>> Exception fixing docBase: {0}
>> java.util.zip.ZipException: The process cannot access the
>> file because it is being used by another process
>>     
>
> Look at the antiJARLocking and antiResourceLocking attributes of the
> <Context> element:
> http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>   

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Problem with auto-deploy

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: david@rushtone.com [mailto:davidarush@gmail.com]
> Subject: Problem with auto-deploy
> 
> 2007-01-09 11:21:44,859
> (org.apache.catalina.startup.ContextConfig,init(),ERROR)
> Exception fixing docBase: {0}
> java.util.zip.ZipException: The process cannot access the
> file because it is being used by another process

Look at the antiJARLocking and antiResourceLocking attributes of the
<Context> element:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org