[jboss-jira] [JBoss JIRA] Commented: (JBVFS-142) NPE in VirtualJarInputStream
John Bailey (JIRA)
jira-events at lists.jboss.org
Fri Mar 5 10:14:10 EST 2010
[ https://jira.jboss.org/jira/browse/JBVFS-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12518374#action_12518374 ]
John Bailey commented on JBVFS-142:
-----------------------------------
This issue is caused when someone invokes VirtualFile.openSteam on a VirtualFile that is a directory. The NullPointer should be cleaned up to give a more reasonable message stating this.
The series of events that causes this is as follows:
VirtualFile jar = ...
VFS.mountZip(jar...)
URL url = jar.toURL();
URLConnection con = url.openConnection();
InputStream is = con.openStream();
is.read(...);
At the point the JAR is mounted, it become a directory in the VFS. So when you ask for an InputStream, the best that can be achieved is a simulated JAR input stream, which would allow child entries to be read.
What happens when an exploded JAR is installed into Felix in a JVM that does not have VFS in use? Does is handle the directory case? Also, can you get a look at what the URL looks like that is being open in each case?
> NPE in VirtualJarInputStream
> ----------------------------
>
> Key: JBVFS-142
> URL: https://jira.jboss.org/jira/browse/JBVFS-142
> Project: JBoss VFS
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 3.0.0.CR3
> Reporter: Thomas Diesler
> Assignee: John Bailey
> Fix For: 3.0.0.CR4
>
>
> Caused by: java.lang.NullPointerException
> at org.jboss.vfs.VirtualJarInputStream.read(VirtualJarInputStream.java:149)
> at org.eclipse.osgi.internal.baseadaptor.AdaptorUtil.readFile(AdaptorUtil.java:75)
> at org.eclipse.osgi.internal.baseadaptor.BundleInstall.begin(BundleInstall.java:77)
> at org.eclipse.osgi.framework.internal.core.Framework.installWorkerPrivileged(Framework.java:922)
> In a Deployer I get a bundle location as String from the configuration.
> I pass the String on to a 3rd party library (i.e. Equinox)
> Equinox does
> URLConnection urlcon = new URL(location).openConnection()
> urlcon.openStream();
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list