[shrinkwrap-issues] [JBoss JIRA] (SHRINKWRAP-512) Shrinkwrap resolver generates invalid Zips

Florian Besser (JIRA) issues at jboss.org
Fri Nov 25 08:37:00 EST 2016


Florian Besser created SHRINKWRAP-512:
-----------------------------------------

             Summary: Shrinkwrap resolver generates invalid Zips
                 Key: SHRINKWRAP-512
                 URL: https://issues.jboss.org/browse/SHRINKWRAP-512
             Project: ShrinkWrap
          Issue Type: Feature Request
            Reporter: Florian Besser
            Priority: Critical


Affects shrinkwrap-resolver-impl-maven:2.2.0 up to shrinkwrap-resolver-impl-maven:2.2.4

The class MavenResolvedArtifactImpl.java generates a zip File using the function packageDirectories.

zipFiles generated by this method contain 1 zipfile entry per file (this is good) *but also 1 entry per _directory_*. This means that wildfly will throw a FileNotFoundException like the following:


{code:java}
14:17:41,203 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."rdp-pricedata-testing.ear".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."X-Y-Z.ear".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "X-Y-Z.ear"
...
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEE0054: Failed to process children for EAR ["/C:/Daten/tools/wildfly-10.1.0.Final/bin/content/X-Y-Z.ear"]
...
Caused by: java.io.FileNotFoundException: C:\Daten\tools\wildfly-10.1.0.Final\standalone\tmp\vfs\deployment\deployment8c1b4b7ccf088d0f\X-Y-other.war-1968e3b71e5fa852\com\sixgroup (The system cannot find the path specified)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(FileOutputStream.java:270)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
	at org.jboss.vfs.VFSUtils.unzip(VFSUtils.java:899)
	at org.jboss.vfs.VFS.mountZipExpanded(VFS.java:504)
	at org.jboss.vfs.VFS.mountZipExpanded(VFS.java:533)
	at org.jboss.as.ee.structure.EarStructureProcessor.mount(EarStructureProcessor.java:252)
	at org.jboss.as.ee.structure.EarStructureProcessor.createResourceRoot(EarStructureProcessor.java:271)
	at org.jboss.as.ee.structure.EarStructureProcessor.deploy(EarStructureProcessor.java:202)
	... 6 more
{code}


I'd suggest amending the code:

{code:java}
if (fileEntry.isDirectory()) {
    zipFile.putNextEntry(new ZipEntry(entry));
}
{code}

to:

{code:java}
if (fileEntry.isDirectory()) {
    continue;
}
{code}




--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the shrinkwrap-issues mailing list