Uploaded image for project: 'JBoss VFS'
  1. JBoss VFS
  2. JBVFS-184

Jars not containing directory entries are not properly reinitialized

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Done
    • 2.2.1.GA
    • None
    • None
    • None
    • 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); }
    • Workaround Exists

    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, 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
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: