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 57706 - [41cat] java.lang.NullPointerExceptionat org.netbeans.modules.java.j2seproject.J2SEProjectUtil.hasMainMethod(J2SEProjectUtil.java:229)
Summary: [41cat] java.lang.NullPointerExceptionat org.netbeans.modules.java.j2seprojec...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: Other Linux
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-10 10:47 UTC by johnzoet
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description johnzoet 2005-04-10 10:47:44 UTC
[ JDK VERSION : 1.5.0_02 ]

After working for a while on my project I canot 
start the project anymore, netiher in debug nor 
in normal mode. 
what I see is that the IDE does not recognize 
anymore which class is the main class 
Error message: 
=> 
java.lang.NullPointerException 
	at 
org.netbeans.modules.java.j2seproject.J2SEProjectUtil.hasMainMethod(J2SEProjectUtil.java:229) 
	at 
org.netbeans.modules.java.j2seproject.J2SEProjectUtil.isMainClass(J2SEProjectUtil.java:164) 
	at 
org.netbeans.modules.java.j2seproject.J2SEActionProvider.isSetMainClass(J2SEActionProvider.java:475) 
	at 
org.netbeans.modules.java.j2seproject.J2SEActionProvider.getTargetNames(J2SEActionProvider.java:194) 
	at 
org.netbeans.modules.java.j2seproject.J2SEActionProvider.invokeAction(J2SEActionProvider.java:125) 
	at 
org.netbeans.modules.project.ui.actions.MainProjectAction.actionPerformed(MainProjectAction.java:90) 
	at 
org.openide.windows.TopComponent.processKeyBinding(TopComponent.java:798) 
	at 
javax.swing.JComponent.processKeyBindings(JComponent.java:2776) 
	at 
javax.swing.JComponent.processKeyEvent(JComponent.java:2693) 
	at 
java.awt.Component.processEvent(Component.java:5265) 
	at 
java.awt.Container.processEvent(Container.java:1966) 
	at 
java.awt.Component.dispatchEventImpl(Component.java:3955) 
	at 
java.awt.Container.dispatchEventImpl(Container.java:2024) 
	at 
java.awt.Component.dispatchEvent(Component.java:3803) 
	at 
java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1810) 
	at 
java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:672) 
	at 
java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:920) 
	at 
java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:798) 
	at 
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:636) 
	at 
java.awt.Component.dispatchEventImpl(Component.java:3841) 
	at 
java.awt.Container.dispatchEventImpl(Container.java:2024) 
	at 
java.awt.Window.dispatchEventImpl(Window.java:1774) 
	at 
java.awt.Component.dispatchEvent(Component.java:3803) 
[catch] at 
java.awt.EventQueue.dispatchEvent(EventQueue.java:463) 
	at 
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242) 
	at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) 
	at 
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) 
	at 
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) 
	at 
java.awt.EventDispatchThread.run(EventDispatchThread.java:110) 
=>
Comment 1 Martin Matula 2005-04-11 09:10:14 UTC
code->j2seproject
Comment 2 Tomas Zezula 2005-04-11 12:35:15 UTC
wrong component. java->javacore.
Comment 3 Martin Matula 2005-04-11 12:55:41 UTC
Could you please elaborate on why you assigned this to javacore? I don't see any
javacore on the stacktrace. The NPE is apparently thrown from J2SE project code.
Reassigning back to j2se project.
Comment 4 Tomas Zezula 2005-04-11 14:20:43 UTC
Simple just look at the line 229 in the J2SEProjectUtil.

227     if (m.getParameters ().size ()==1) {
228        Parameter par = ((Parameter) m.getParameters ().get (0));
229        String typeName = par.getType ().getName ();


If par == NULL => m.getParameters() returns Set containing null -> javacore problem
If par.getType() == NULL -> javacore problem
Comment 5 Martin Matula 2005-04-11 14:26:08 UTC
Hm. The J2SEProjectUtil class I have on my disk looks differently.
I guess we need to have the exact build number to be sure that we properly
evaluated the issue.
Johnzoet, could you please attach your IDE log file? ($nbuser/var/log/messages.log)
Comment 6 johnzoet 2005-05-03 05:23:56 UTC
Problem does not occur anymore. 
 
Comment 7 Quality Engineering 2007-09-20 12:04:25 UTC
Reorganization of java component