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 198776 - NullPointerException at org.netbeans.modules.swingapp.AppFrameworkSupport.getApplicationClassName
Summary: NullPointerException at org.netbeans.modules.swingapp.AppFrameworkSupport.get...
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: App Framework (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-20 18:41 UTC by Gakuru
Modified: 2011-05-26 12:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 18214


Attachments
stacktrace (1.41 KB, text/plain)
2011-05-20 18:41 UTC, Gakuru
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gakuru 2011-05-20 18:41:31 UTC
Build: NetBeans IDE 7.0 Beta 2 (Build 201102140001)
VM: Java HotSpot(TM) Client VM, 19.1-b02, Java(TM) SE Runtime Environment, 1.6.0_24-b07
OS: Linux

User Comments:
GUEST: created a project with same name and location as previous project name and location after manually deleting the old project directory

GUEST: Opening existing java project right after IDE started.

GUEST: I was editing the properties of the project and selecting the Desktop Application entry, which would not display.

GUEST: Creating a new application




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.swingapp.AppFrameworkSupport.getApplicationClassName(AppFrameworkSupport.java:268)
   at org.netbeans.modules.swingapp.AppFrameworkSupport.getApplicationClassName(AppFrameworkSupport.java:196)
   at org.netbeans.modules.swingapp.ResourceUtils.getAppDesignResourceMap(ResourceUtils.java:151)
   at org.netbeans.modules.swingapp.ProjectCustomizerProvider$ApplicationPropertyChangeListener.propertyChange(ProjectCustomizerProvider.java:162)
   at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
   at org.netbeans.spi.project.support.ant.SequentialPropertyEvaluator.stateChanged(SequentialPropertyEvaluator.java:208)
Comment 1 Gakuru 2011-05-20 18:41:35 UTC
Created attachment 108424 [details]
stacktrace
Comment 2 Jan Stola 2011-05-26 12:14:50 UTC
The exception is thrown on the following line:

if (cp.findResource(appClassName.replace('.', '/') + ".java") == null) { 

The preceding code guarantees that appClassName is not null. Hence, cp is null. I am not sure how to reproduce this problem, but ClassPath.getClassPath() clearly states that it may return null. Hence, I have added a check for this case.

On the other hand, the attached reports show that the reported exception is preceded by an exception from project.xml parsing. Therefore, the root of the problem is probably somewhere else, but we would need a reproducible test case to find it.

Modified file: http://hg.netbeans.org/jet-main/rev/2dd32a18e60e