Community
Participate
Working Groups
Created attachment 79726 [details] .log Driver: M-2.0.2-20071004053715 1. Start Eclipse in a new workspace. 2. Open the Error view. 3. Execute the "Create a Web 2.4 project" step from the smoke test scenario: http://wiki.eclipse.org/J2EE_Smoke_Test_%28WTP_2.0%29#Create_a_Web_2.4_project (Mind the prerequisites) It should be, when the XDoclet builder executes, a NullPointerException is logged. The .log is attached. There is no visual consequences from this error.
JEM bug- getJavaProject should return null if the parameter is null, instead of throwing an NPE.
Created attachment 79828 [details] Add a null check- if the parameter is null, return null.
Committed to both 2.0.2 and 3.0.
Hi Carl, You have indeed fixed the described the described NPE, but now another one appears. I reopen this bug, because the symptoms are the same. Greetings, Kaloyan
Created attachment 80206 [details] .log #2 .log with the new NullPointerException
The next NPE is in the XDoclet code.
This bug was actually introduced by the org.eclipse.ui.workbench plugin - probably when solving bug 73872. Steps to reproduce: 1. Start Eclipse with the WTP plugins in a new workspace. 2. Open the Error view. 3. Create a new Dynamic Web 2.4 Project with the XDoclet facet enabled. 4. Right-click on the newly created project. The NPE appears in the console log. The reason for the NPE is because org.eclipse.jst.j2ee.ejb.annotations.internal.xdoclet.action.XDocletActionDelegate (plugin org.eclipse.jst.j2ee.ejb.annotations.xdoclet) receives in method selectionChanged(IAction, ISelection):58 an empty selection as an argument. But in fact there is a real selection, because the user has right clicked on the project. Digging on the stack trace: Thread [main] (Suspended (breakpoint at line 70 in XDocletActionDelegate)) RunXDocletAction(XDocletActionDelegate).getFirstSourceFile() line: 70 RunXDocletAction.selectionChanged(IAction, ISelection) line: 60 <unknown receiving type>(PluginAction).refreshEnablement() line: 208 <unknown receiving type>(PluginAction).createDelegate() line: 128 <unknown receiving type>(PluginAction).selectionChanged(ISelection) line: 277 <unknown receiving type>(PluginAction).<init>(IConfigurationElement, String, int) line: 112 ....... It turns out that in PluginAction constructor on line 112 there is a call: selectionChanged(StructuredSelection.EMPTY); The problem would be solved that if the above is replaced with a call to "selectionChanged()" with the current selection.
Created attachment 84663 [details] patch I attach a patch with the suggested solution described in the previous comment. This patch solves the issue for WTP.
This patch cannot be accepted as is ... it is valid for selectionChanged(*) to be called with EMPTY_SELECTION, you *must* handle it. PW
Created attachment 84949 [details] patch 2 Resolves the NPE in the o.e.j.j2ee.ejb.annotations.xdoclet plugin.
patch 2 is dropped to HEAD. The o.e.j.j2ee.ejb.annotations.xdoclet plugin is not branched, so the patch goes in both 2.0.2 and 3.0.
Verified with the S-3.0M4-20071227065330 build.
Verified with the M-2.0.2-20080131091038 build, too.
*** Bug 158570 has been marked as a duplicate of this bug. ***
*** Bug 163673 has been marked as a duplicate of this bug. ***
*** Bug 167643 has been marked as a duplicate of this bug. ***
*** Bug 169896 has been marked as a duplicate of this bug. ***
*** Bug 170952 has been marked as a duplicate of this bug. ***
*** Bug 192503 has been marked as a duplicate of this bug. ***
Closing