Take the 2-minute tour ×


Server: jboss-5.1.0
Java Version: jdk1.6.0_14
Deployment Method: ant v1.7
Error: 08:40:04,260 WARN [ZipEntryContext] IGNORING: Failed to reinitialize context: vfszip:/home/username/jboss-5.1.0.GA/server/default/deploy/deployment.war
java.util.zip.ZipException: error in opening zip file

Error occurs if the server is running and I run an ant deploy on my src code. This is all being done via VI on our server.

I have searched our JBOSS settings but, cant seem to find the correct one to get rid of this error. Ideas?

Here is our deployment method.

<target name="deploy" depends="war" description="--> The deploy target (initially empty)">
    <copy file="scripts/xmlscript.groovy" todir="${jboss.bin.dir}" overwrite="true"/>
    <copy file="grails-app/views/xmlService/current.xml" todir="${jboss.bin.dir}" overwrite="true"/>
    <copy file="${war.file}" todir="${jboss.deploy.dir}" overwrite="true"/>


share|improve this question
What does "ant deploy" perform exactly? Does it build the war under JBoss deploy directory or does it copy a WAR? –  Pascal Thivent Dec 7 '09 at 15:45
Edited post to add in our deployment method. –  ahstewt Dec 7 '09 at 16:24

2 Answers 2

up vote 2 down vote accepted

Not sure but, according to JBAS-6612:

This is an issue due to the fact that the copy is not atomic. To work around this issue temporarily, use the move command instead as it is atomic.

Could you try to use the Ant move task instead of copy?

share|improve this answer
Thank you very much. This seemed to fix our problem. –  ahstewt Dec 9 '09 at 15:12
You're welcome. Glad it was helpful. –  Pascal Thivent Dec 9 '09 at 15:19
Link broken for ant move task. –  Abhijeet Kashnia Nov 10 '10 at 14:42
@Abhijeet Thanks, fixed. –  Pascal Thivent Nov 10 '10 at 14:48

Hard to say, but my guess is that JBoss is trying to open and deploy your WAR file before it has been fully copied by Ant. This is always the risk when copying into the deploy directory of a running JBoss server.

It's safer to do this only when JBoss is turned off, although obviously that's not an ideal situation. Alternatively, you can either disable the deployment scanner (which automatically detects deployable content under deploy) and manually control deployments via JMX (which is a bit fiddly), or you can reduce the frequency that the deployment scanner runs (which default to every 5 seconds, defined in deploy/hdscanner-jboss-beans.xml).

share|improve this answer
Great advice Skaffman but, it seems as if it did NOT fix our issue. –  ahstewt Dec 7 '09 at 16:22

Your Answer


