Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365121 - EJB Project wizard doesn't show up and shows an error
Summary: EJB Project wizard doesn't show up and shows an error
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.2.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.5 P   Edit
Assignee: Galileo Perez CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-29 13:52 EST by Galileo Perez CLA
Modified: 2011-12-01 15:40 EST (History)
1 user (show)

See Also:
ccc: review+


Attachments
Prevents the NPE error while creating EJB Projects (8.16 KB, patch)
2011-11-29 13:54 EST, Galileo Perez CLA
no flags Details | Diff
Prevents NPE (7.02 KB, patch)
2011-11-30 12:40 EST, Galileo Perez CLA
ccc: iplog+
Details | Diff
null check for runtime on 364993 (1.88 KB, patch)
2011-11-30 17:07 EST, Galileo Perez CLA
ccc: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Galileo Perez CLA 2011-11-29 13:52:00 EST
Build Identifier: Eclipse 3.6.2

Using an adopter product over eclipse 3.7.1 and WTP when creating an EJB
project on a workspace with two runtimes, one supports a facet and the other
doesn't. The wizard never appears and log. file shows a NPE.

java.lang.NullPointerException
    at
org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.setProjectFacets(FacetedProjectWorkingCopy.java:726)
    at
org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard.setRuntimeAndDefaultFacets(NewProjectDataModelFacetWizard.java:261)
    at
org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard.createPageControls(NewProjectDataModelFacetWizard.java:150)
    at
org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:736)
    at
org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:608)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)



Reproducible: Always

Steps to Reproduce:
1.Install the two runtimes with EJB facet that is not supported in one of them
2.Create a web project with runtime of the runtime that does not support the
EJB facet and check the Add project to EAR checkbox
3.File > New > EJB Project
Comment 1 Galileo Perez CLA 2011-11-29 13:54:51 EST
Created attachment 207680 [details]
Prevents the NPE error while creating EJB Projects

Prevents the NPE error while creating EJB Projects
Comment 2 Carl Anderson CLA 2011-11-29 14:12:51 EST
To clarify, this is the addition of a simple null pointer check to WTP 3.2.5, via a patch.
Comment 3 Carl Anderson CLA 2011-11-29 14:15:57 EST
The Eclipse Portal is not allowing me to add a target of 3.2.5 P to Common's Target Milestones.  I am setting this with a target of 3.2.5 for now, and will retarget as soon as the issue with the Portal is resolved.
Comment 4 Konstantin Komissarchik CLA 2011-11-29 21:30:44 EST
-1 on the change to ProjectFacet. It doesn't seem necessary and changes behavior of an API. The caller can easily make sure that it isn't passing a null into this method. There no inherent assumption in this method that it should accept null parameter values.
Comment 5 Galileo Perez CLA 2011-11-30 12:40:58 EST
Created attachment 207747 [details]
Prevents NPE

Changes to Konstantin's code was rolled back
Comment 6 Galileo Perez CLA 2011-11-30 17:07:50 EST
Created attachment 207765 [details]
null check for runtime on 364993

Avoids the NPE when creating the EJB client
Comment 7 Carl Anderson CLA 2011-12-01 15:40:51 EST
Both patches were committed to R3_2_5_patches