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 157511 - NullPointerException at org.netbeans.modules.java.api.common.SourceRoots$6.run
Summary: NullPointerException at org.netbeans.modules.java.api.common.SourceRoots$6.run
Status: RESOLVED WORKSFORME
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: David Konecny
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-27 19:19 UTC by ralphlevan
Modified: 2009-04-07 01:26 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 145601


Attachments
stacktrace (1.61 KB, text/plain)
2009-01-27 19:19 UTC, ralphlevan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ralphlevan 2009-01-27 19:19:00 UTC
Build: NetBeans IDE 6.5 (Build 200811100001)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05, Java(TM) SE Runtime Environment, 1.6.0_03-b05
OS: Windows Vista, 6.0, x86

Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.java.api.common.SourceRoots$6.run(SourceRoots.java:334)
        at org.openide.util.Mutex.writeAccess(Mutex.java:469)
        at org.netbeans.modules.java.api.common.SourceRoots.putRoots(SourceRoots.java:321)
        at org.netbeans.modules.web.project.ui.customizer.WebProjectProperties.storeRoots(WebProjectProperties.java:809)
        at org.netbeans.modules.web.project.ui.customizer.WebProjectProperties.storeProperties(WebProjectProperties.java:560)
        at org.netbeans.modules.web.project.ui.customizer.WebProjectProperties.access$200(WebProjectProperties.java:118)
Comment 1 ralphlevan 2009-01-27 19:19:09 UTC
Created attachment 76273 [details]
stacktrace
Comment 2 ralphlevan 2009-01-29 14:33:59 UTC
I believe I have tracked down the problem that is causing the NPE.  Sorry for the long-ish story, but it sets the 
background.

I have a web project that pre-dates release 6.5.  That project had no source files, it simply packaged a number of 
jars and configuration files.

In NetBeans 6.5, if I try to make a change to the properties of that project, I get the NPE.  I needed to make a 
change.  I tried editing the project.xml file manually to get around the NPE issue and NetBeans 6.5 refused to open 
the project after any editing, including simply adding whitespace.  The Open Project dialog would give me an error 
message about a problem in the XML.  I eventually tracked it down to a missing mandatory <source-roots> element.  When 
I added one manually, all the NetBeans problems went away.  Apparently, that element was not mandatory (or the file 
was not validated) in earlier releases of NetBeans.

So, I'm guessing that the NPE came as a result of the poor handling of a validation failure when trying to save a 
changed project.xml

Hope this helps!

Ralph
Comment 3 Jan Lahoda 2009-02-02 15:26:42 UTC
Not related to java.source (api.java.common != java.source), should be first investigated in Web Projects, IMO.
Comment 4 David Konecny 2009-04-07 01:26:20 UTC
I tried to open project with missing <source-roots> element but IDE refuses it as invalid project.xml so in a way that
prevents the NPE. :-) Yes, project.xml validation was added in recent releases because project.xml was not always valid
against its XML schema. Considering there are no other duplicates of this exception I'm closing this as WORKSFORME. Do
not hesitate to object if you disagree or still have the problem.