Jboss war redeployment Zipexception
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 I can't 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>
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?
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
).
精彩评论