This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 136536 - NPE in JarClassLoader
Summary: NPE in JarClassLoader
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks: 134424
  Show dependency tree
 
Reported: 2008-06-05 10:40 UTC by sreimers
Modified: 2008-12-23 08:38 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Stcktrace (1.17 KB, text/plain)
2008-06-05 14:53 UTC, sreimers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sreimers 2008-06-05 10:40:05 UTC
Seen on a NetBeans platform based application:

A NPE is thrown during application startup in

org.netbeans.JarClassLoader$ResURLConnection.getJarFile(JarClassLoader.java:758). 

It is triggered during ModuleInstall code trying to open a url to read a ressource. The problem cause seems to be that
src.jar is accessed directly before it is lazy initialized via src.getJarFile().
Comment 1 Jesse Glick 2008-06-05 14:10:23 UTC
I need a self-contained minimal test case please, not to mention a complete stack trace.
Comment 2 sreimers 2008-06-05 14:53:38 UTC
Created attachment 62411 [details]
Stcktrace
Comment 3 sreimers 2008-06-05 15:06:29 UTC
Since I have difficulties reproducing it, I think all I can give you actually is the stacktrace I just attached.

Any reason why you chose to access src.jar directly and not via src.getJarFile()?



Comment 4 Jesse Glick 2008-06-05 15:26:17 UTC
getJarFile has various side effects I don't think I want here. I think

  new JarFile(src.file)

should work however. core-main #2838c2a7bef3
Comment 5 sreimers 2008-06-05 20:52:30 UTC
Ok. Thanks for your fast response. I will try your fix and put the problem under our internal observation and let you
know if it works.
Comment 6 Jesse Glick 2008-06-05 21:37:30 UTC
Great. In the next day or two you should see a notification that the fix has appeared in a nightly build. If you manage
to test the fix, you can either "Reopen issue" or "Mark issue as VERIFIED" according to the result.
Comment 7 Quality Engineering 2008-06-06 04:17:34 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #240 build
Changeset: http://hg.netbeans.org/main/rev/2838c2a7bef3
User: Jesse Glick <jglick@netbeans.org>
Log: #136536: NPE calling getJarFile() under obscure conditions.
Comment 8 sreimers 2008-07-09 21:39:54 UTC
Works for me with latest changes. Thanks.