[jboss-jira] [JBoss JIRA] (JBVFS-182) Access of URLs with jar:file: scheme causes an NPE when setting -Djboss.vfs.forceCanonical=true

Chris Sams (JIRA) jira-events at lists.jboss.org
Tue Jun 12 13:30:04 EDT 2012


Chris Sams created JBVFS-182:
--------------------------------

             Summary: Access of URLs with jar:file: scheme causes an NPE when setting -Djboss.vfs.forceCanonical=true
                 Key: JBVFS-182
                 URL: https://issues.jboss.org/browse/JBVFS-182
             Project: JBoss VFS
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Release
    Affects Versions:  2.2.0.GA
            Reporter: Chris Sams
            Assignee: John Bailey


Accessing a jar:file: URL causes an NPE if -Djboss.vfs.forceCanonical=true

Add the following to SymlinkTestCase.java:

   public void testJarFileScheme() throws Exception
   {   
      URL url = getResource("/vfs/test/level1.zip");
      try 
      {   
        VFS vfs = VFS.getVFS(new URL("jar:file:" + url.getPath() + "!/" + "level2.zip/level3.zip"));
      }   
      catch(NullPointerException npe)
      {   
        failure("NPE thrown because jar:file: not handled by canonicalization code.", npe);
      }   
   }

Results in:

testJarFileScheme(org.jboss.test.virtual.test.SymlinkTestCase)  Time elapsed: 0.015 sec  <<< FAILURE!
junit.framework.AssertionFailedError: NPE thrown because jar:file: not handled by canonicalization code.
...
<snip>
...
Caused by: java.lang.NullPointerException
  at java.io.File.<init>(File.java:222)
  at org.jboss.virtual.plugins.registry.DefaultVFSRegistry.canonicalize(DefaultVFSRegistry.java:124)
  at org.jboss.virtual.plugins.registry.DefaultVFSRegistry.getContext(DefaultVFSRegistry.java:144)
  at org.jboss.virtual.VFS.getVFS(VFS.java:203)
  at org.jboss.virtual.VFS.getVFS(VFS.java:184)
  at org.jboss.virtual.VFS.getVFS(VFS.java:287)
  at org.jboss.test.virtual.test.SymlinkTestCase.testJarFileScheme(SymlinkTestCase.java:174)


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list