Paul Percier
Paul Percier

Reputation: 1

Jetty 9 fails to resume context du to War MALFORMED error

Since we centralized many applications on the same server, we observe sometimes (more and more frequently) that when we upload jar or war, the context did'nt start.

Example : when we upload AcmeOne.jar, we obtain :

FINEST|32197/0|22-01-19 15:55:04|[Scanner-0] WARN org.eclipse.jetty.webapp.WebAppContext - Failed startup of context o.e.j.w.WebAppContext@53374f78{/CLIENT_X/ACME_ONE,file:///opt/acme/ApplicationsServer/AcmeWSServer/work/AcmeOneClientX/webapp/,UNAVAILABLE}{/opt/acme/ApplicationsServer/Jetty/V9.4.8/../../AcmeWSServer/V4.14/AcmeWSServer.war} FINEST|32197/0|22-01-19 15:55:04|java.lang.IllegalArgumentException: MALFORMED FINEST|32197/0|22-01-19 15:55:04| at java.util.zip.ZipCoder.toString(ZipCoder.java:58) FINEST|32197/0|22-01-19 15:55:04| at java.util.zip.ZipFile.getZipEntry(ZipFile.java:583) FINEST|32197/0|22-01-19 15:55:04| at java.util.zip.ZipFile.access$900(ZipFile.java:60) FINEST|32197/0|22-01-19 15:55:04| at java.util.zip.ZipFile$ZipEntryIterator.next(ZipFile.java:539) FINEST|32197/0|22-01-19 15:55:04| at java.util.zip.ZipFile$ZipEntryIterator.nextElement(ZipFile.java:514) FINEST|32197/0|22-01-19 15:55:04| at java.util.zip.ZipFile$ZipEntryIterator.nextElement(ZipFile.java:495) FINEST|32197/0|22-01-19 15:55:04| at java.util.jar.JarFile$JarEntryIterator.next(JarFile.java:257) FINEST|32197/0|22-01-19 15:55:04| at java.util.jar.JarFile$JarEntryIterator.nextElement(JarFile.java:266) FINEST|32197/0|22-01-19 15:55:04| at java.util.jar.JarFile$JarEntryIterator.nextElement(JarFile.java:247) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.webapp.MetaInfConfiguration.getTlds(MetaInfConfiguration.java:442) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.webapp.MetaInfConfiguration.scanForTlds(MetaInfConfiguration.java:355) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.webapp.MetaInfConfiguration.scanJars(MetaInfConfiguration.java:173) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.webapp.MetaInfConfiguration.preConfigure(MetaInfConfiguration.java:107) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:506) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:544) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:41) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:188) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:502) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:150) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:453) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:610) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:529) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.util.Scanner.scan(Scanner.java:392) FINEST|32197/0|22-01-19 15:55:04| at org.eclipse.jetty.util.Scanner$1.run(Scanner.java:329) FINEST|32197/0|22-01-19 15:55:04| at java.util.TimerThread.mainLoop(Timer.java:555) FINEST|32197/0|22-01-19 15:55:04| at java.util.TimerThread.run(Timer.java:505)

If we restart jetty. All contexts start correctly.

Note : AcmeWSServer gives to AcmeOne acces to database and to other functionnalities.

AcmeOneApplicationContext :

   ...
   <New class="java.lang.String" id="AcmeWSServerHome">
           <Arg><SystemProperty default="." name="jetty.home"/>/../../AcmeWSServer/V4.14</Arg>
   </New>

   <New class="java.lang.String" id="DeployDir">
           <Arg><Ref id="AcmeWSServerHome"/>/../work/<Ref id="ApplicationName"/></Arg>
   </New>


   <!-- Context configuration -->
   <Set name="war"><Ref id="AcmeWSServerHome"/>/AcmeWSServer.war</Set>
   <Set name="extractWAR">true</Set>
   <Set name="tempDirectory"><Ref id="DeployDir"/></Set>
   <Set name="copyWebDir">true</Set>
   <Set name="overrideDescriptor"><Ref id="ApplicationHome"/>/AcmeWSServer.d/override-web.xml</Set>
   <Set name="extraClasspath"><Ref id="ApplicationHome"/>/Java/AcmeOne/bin/AcmeOne.jar</Set>
   <Set name="welcomeFiles">
        <Array type="String">
            <Item>Acme.html</Item>
        </Array>
   </Set>
   ...

Update : The AcmeWSServer.war is unchanged when we upload AcmeOne.jar.

When we restart Jetty, AcmeWSServer.war and AcmeOn.jar are correctly load.

Maybe a memory issue ?

Upvotes: 0

Views: 119

Answers (1)

Joakim Erdfelt
Joakim Erdfelt

Reputation: 49545

FINEST|32197/0|22-01-19 15:55:04|[Scanner-0] WARN org.eclipse.jetty.webapp.WebAppContext - Failed startup of context o.e.j.w.WebAppContext@53374f78{/CLIENT_X/ACME_ONE,file:///opt/acme/ApplicationsServer/AcmeWSServer/work/AcmeOneClientX/webapp/,UNAVAILABLE}{/opt/acme/ApplicationsServer/Jetty/V9.4.8/../../AcmeWSServer/V4.14/AcmeWSServer.war} 
FINEST|32197/0|22-01-19 15:55:04|java.lang.IllegalArgumentException: MALFORMED 
FINEST|32197/0|22-01-19 15:55:04| at java.util.zip.ZipCoder.toString(ZipCoder.java:58) 
FINEST|32197/0|22-01-19 15:55:04| at java.util.zip.ZipFile.getZipEntry(ZipFile.java:583) 
FINEST|32197/0|22-01-19 15:55:04| at java.util.zip.ZipFile.access$900(ZipFile.java:60)

According to the error, you have a broken JAR/WAR file.

The file at .../AcmeWSServer/V4.14/AcmeWSServer.war is likely corrupted (at the time when it is requested to be deployed) and cannot be extracted by Java itself.

Not much that Jetty can do to fix this situation.

Upvotes: 0

Related Questions