[jboss-jira] [JBoss JIRA] (JBVFS-202) Invalid Local file header in ZIP file

Martin Both (JIRA) issues at jboss.org
Mon Nov 9 09:29:00 EST 2015


    [ https://issues.jboss.org/browse/JBVFS-202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13126873#comment-13126873 ] 

Martin Both commented on JBVFS-202:
-----------------------------------

Yes, that is what I mean. And that is my way to reproduce this.
I try to fix it, but It is not easy because there are more than one bug in this class.
Does this class work elsewhere? I don't think so.
Here is the specification of a ZIP archive:
https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

I try to fix the code with
        if(jarEntry.isDirectory()){
        	bufferInt(0);
        	bufferInt(0); 
        }else{
        	bufferInt(jarEntry.getSize());                  // Compressed size
        	bufferInt(jarEntry.getSize());                  // Uncompressed size
        }
but another error(s) must exists in the zip file structure. Because any unzip tool ends with an error message.

Martin


> Invalid Local file header in ZIP file
> -------------------------------------
>
>                 Key: JBVFS-202
>                 URL: https://issues.jboss.org/browse/JBVFS-202
>             Project: JBoss VFS
>          Issue Type: Bug
>            Reporter: Martin Both
>            Assignee: Tomaz Cerar
>
> I'm try to use the Embeddable EJBContainer of JBoss EAP 6.4.
> I get a ZipException: invalid CEN header (bad signature)
> JBoss writes an invalid Zip- file in
> JBossEAP6.4\standalone\data\content\58\a481cdfbe31a8ad823b6708f17151589954ac6/content
> The reason is, that the zip file content contains a Local file header with no size for the file data. No Zip-Tool can unzip that and even JBoss cannot read that again.
> Compare the method bufferLocalFileHeader() with the method bufferNextCentralFileHeader() of class org.jboss.vfs,VirtualJarFileInputStream.
> The one wirtes file sizes the other one not. If you would read the file format specification of zip files than you would know that after the LocallFileHeader the file data is written. Without knowledge of the compressed size it is not possible to read that.
> Deployment with Embeddable EJBContainer does not work for me due to this bug.
> Trace:
> 2015-11-09 11:16:02,392 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.4.0.GA (AS 7.5.0.Final-redhat-21) wurde gestartet in 2502ms - 168 von 205 Diensten gestartet (61 Services sind "lazy", passiv oder werden bei Bedarf geladen)
> 2015-11-09 11:16:03,094 INFO  [org.jboss.as.repository] (pool-4-thread-1) JBAS014900: Content an Speicherort C:\Users\A300859\workspaces\ProKom2.0_trunk\Servers\JBossEAP6.4\standalone\data\content\58\a481cdfbe31a8ad823b6708f17151589954ac6\content hinzugefügt
> 2015-11-09 11:16:03,120 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starte Deployment von "classes" (runtime-name: "classes")
> 2015-11-09 11:16:03,159 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit.classes.STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit.classes.STRUCTURE: JBAS018733: Verarbeitung von Phase STRUCTURE von deployment "classes" fehlgeschlagen
> 	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [jboss-as-server-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
> 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
> 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_60]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_60]
> 	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]
> Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018740: Einhängen des Deployment-Contents fehlgeschlagen
> 	at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:97) [jboss-as-server-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
> 	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [jboss-as-server-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
> 	... 5 more
> Caused by: java.util.zip.ZipException: invalid CEN header (bad signature)
> 	at java.util.zip.ZipFile.open(Native Method) [rt.jar:1.8.0_60]
> 	at java.util.zip.ZipFile.<init>(ZipFile.java:219) [rt.jar:1.8.0_60]
> 	at java.util.zip.ZipFile.<init>(ZipFile.java:149) [rt.jar:1.8.0_60]
> 	at java.util.jar.JarFile.<init>(JarFile.java:166) [rt.jar:1.8.0_60]
> 	at java.util.jar.JarFile.<init>(JarFile.java:130) [rt.jar:1.8.0_60]
> 	at org.jboss.vfs.spi.JavaZipFileSystem.<init>(JavaZipFileSystem.java:90) [jboss-vfs-3.2.9.Final-redhat-1.jar:3.2.9.Final-redhat-1]
> 	at org.jboss.vfs.spi.JavaZipFileSystem.<init>(JavaZipFileSystem.java:77) [jboss-vfs-3.2.9.Final-redhat-1.jar:3.2.9.Final-redhat-1]
> 	at org.jboss.vfs.VFS.mountZip(VFS.java:386) [jboss-vfs-3.2.9.Final-redhat-1.jar:3.2.9.Final-redhat-1]
> 	at org.jboss.vfs.VFS.mountZip(VFS.java:410) [jboss-vfs-3.2.9.Final-redhat-1.jar:3.2.9.Final-redhat-1]
> 	at org.jboss.as.server.deployment.DeploymentMountProvider$Factory$ServerDeploymentRepositoryImpl.mountDeploymentContent(DeploymentMountProvider.java:105) [jboss-as-server-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
> 	at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:93) [jboss-as-server-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
> 	... 6 more
> 2015-11-09 11:16:03,161 ERROR [org.jboss.as.controller.management-operation] (pool-4-thread-1) JBAS014612: Operation ("deploy") fehlgeschlagen - Adresse: ([("deployment" => "classes")]) - Fehlerbeschreibung: {"JBAS014671: Fehlgeschlagene Dienste" => {"jboss.deployment.unit.classes.STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.classes.STRUCTURE: JBAS018733: Verarbeitung von Phase STRUCTURE von deployment \"classes\" fehlgeschlagen
>     Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018740: Einhängen des Deployment-Contents fehlgeschlagen
>     Caused by: java.util.zip.ZipException: invalid CEN header (bad signature)"}}
> 2015-11-09 11:16:03,163 ERROR [org.jboss.as.server] (pool-4-thread-1) JBAS015870: Deploy von Deployment "classes" wurde mit folgender Fehlermeldung zurückgesetzt: 
> {"JBAS014671: Fehlgeschlagene Dienste" => {"jboss.deployment.unit.classes.STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.classes.STRUCTURE: JBAS018733: Verarbeitung von Phase STRUCTURE von deployment \"classes\" fehlgeschlagen
>     Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018740: Einhängen des Deployment-Contents fehlgeschlagen
>     Caused by: java.util.zip.ZipException: invalid CEN header (bad signature)"}} 
> 2015-11-09 11:16:03,165 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Deployment von classes in (runtime-name: "classes") 2ms gestoppt
> 2015-11-09 11:16:03,166 INFO  [org.jboss.as.controller] (pool-4-thread-1) JBAS014774: Dienst-Statusbericht
> JBAS014777: Dienste, deren Start fehlgeschlagen ist:      service jboss.deployment.unit.classes.STRUCTURE



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)



More information about the jboss-jira mailing list