Uploaded image for project: 'ShrinkWrap Resolvers'
  1. ShrinkWrap Resolvers
  2. SHRINKRES-259

Shrinkwrap resolver generates invalid Zips

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4
    • Fix Version/s: 3.0.0-alpha-3, 2.2.5
    • Component/s: None
    • Labels:
      None
    • Estimated Difficulty:
      Low

      Description

      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:

      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
      

      I'd suggest amending the code:

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

      to:

      if (fileEntry.isDirectory()) {
          continue;
      }
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                florian.besser Florian Besser
                Reporter:
                florian.besser Florian Besser
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: