I have a WAR file. I would like to open it, edit an XML file, remove some jars and then re-package it.
I used WINRAR to open the WAR file and I removed some Jars and did an 'Add to Archive' in WinRar and created a WAR.
When I deployed the WAR in jboss folder, I got an exception.
16:05:14,316 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2)
MSC00001: Failed to start service jboss.deployment.unit."myapplication.war".
STRUCTURE: org.jboss.msc.service.StartException in
service jboss.deployment.unit."myapplication.war".STRUCTURE:
Failed to process phase STRUCTURE of deployment "myapplication.war"
How do I repackage the WAR ?
you can update your war from the command line using java commands as mentioned here:
jar -uvf test.war yourclassesdir
Other useful commands:
Command to unzip/explode the war file
jar -xvf test.war
Command to create the war file
jar -cvf test.war yourclassesdir
Eg:
jar -cvf test.war *
jar -cvf test.war WEB-INF META-INF