views:

224

answers:

2

All,

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?

Update:
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"/>
</target>

Thanks.

+1  A: 

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).

skaffman
Great advice Skaffman but, it seems as if it did NOT fix our issue.
tathamr
+2  A: 

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?

Pascal Thivent
Thank you very much. This seemed to fix our problem.
tathamr
You're welcome. Glad it was helpful.
Pascal Thivent