Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-10642

Jars not containing directory entries not properly reinitialized by VFS

    XMLWordPrintable

Details

    • Hide
         @Test
         public void testScanMetaInf() throws Exception
         {   
            final URL jarURL = ScanMetaInfTestCase.class.getResource("/vfs/test/jar1-filesonly.jar");
            final URL metaInfURL = new URL("vfszip", null, jarURL.getPath() + "/META-INF/");
            final VirtualFile metaInfRoot = VFS.getRoot(metaInfURL);
            final VirtualFile mfFile = metaInfRoot.getChild("MANIFEST.MF");
            InputStream is = mfFile.openStream();
            final Manifest mf = new Manifest(is);
            mfFile.close();
            final String title = mf.getMainAttributes().getValue(Attributes.Name.SPECIFICATION_TITLE);
            assertEquals(Attributes.Name.SPECIFICATION_TITLE.toString(), "jar1-filesonly", title);
         }   
      
      Show
      @Test public void testScanMetaInf() throws Exception { final URL jarURL = ScanMetaInfTestCase. class. getResource( "/vfs/test/jar1-filesonly.jar" ); final URL metaInfURL = new URL( "vfszip" , null , jarURL.getPath() + "/META-INF/" ); final VirtualFile metaInfRoot = VFS.getRoot(metaInfURL); final VirtualFile mfFile = metaInfRoot.getChild( "MANIFEST.MF" ); InputStream is = mfFile.openStream(); final Manifest mf = new Manifest(is); mfFile.close(); final String title = mf.getMainAttributes().getValue(Attributes.Name.SPECIFICATION_TITLE); assertEquals(Attributes.Name.SPECIFICATION_TITLE.toString(), "jar1-filesonly" , title); }
    • Hide
      <para>If a JAR did not contain directory entries (for example, if it was created with <command>zip -D</command< or <command>--no-dir-entries</command>), and it is reinitialized by VFS, when an attempt is made to access a directory within the JAR, the following exception is thrown: <code>java.lang.RuntimeException: Failed to initialize ZipWrapper</code>. This issue has been fixed in this release, and VFS can now resolve directories of JARs that do not contain directory entries.</para>
      Show
      <para>If a JAR did not contain directory entries (for example, if it was created with <command>zip -D</command< or <command>--no-dir-entries</command>), and it is reinitialized by VFS, when an attempt is made to access a directory within the JAR, the following exception is thrown: <code>java.lang.RuntimeException: Failed to initialize ZipWrapper</code>. This issue has been fixed in this release, and VFS can now resolve directories of JARs that do not contain directory entries.</para>
    • Documented as Resolved Issue
    • NEW

    Description

      If a jar that does not contain directory entries (perhaps it was created with zip -D or --no-dir-entries) is reinitialized by VFS and an attempt is made to access a directory within it, an exception is thrown:

      java.lang.RuntimeException: Failed to initialize ZipWrapper: /apps/barc-middleware/applications/jboss-as/servers/swebitpd-websupp/deployers/jbossws.deployer/spring-core.jar/META-INF/
      at org.jboss.virtual.plugins.context.zip.ZipEntryContext.getZipSource(ZipEntryContext.java:286)
      at org.jboss.virtual.plugins.context.zip.ZipEntryContext.ensureEntries(ZipEntryContext.java:638)
      at org.jboss.virtual.plugins.context.zip.ZipEntryContext.checkIfModified(ZipEntryContext.java:786)
      at org.jboss.virtual.plugins.context.zip.ZipEntryContext.getChildren(ZipEntryContext.java:858)
      at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:337)
      at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:307)
      at org.jboss.virtual.VFS.visit(VFS.java:468)
      at org.jboss.virtual.VirtualFile.visit(VirtualFile.java:448)

      Attachments

        Issue Links

          Activity

            People

              rhn-engineering-cdewolf Carlo de Wolf
              rhn-support-csams Christopher Sams
              Tyler Kelly Tyler Kelly (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: