Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366866

Summary: EJB Project wizard doesn't show up and shows an error
Product: [WebTools] WTP Java EE Tools Reporter: Galileo Perez <galileo>
Component: jst.j2eeAssignee: Galileo Perez <galileo>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: ccc, neil.hauge, shr31223
Version: unspecifiedFlags: cbridgha: pmc_approved? (david_williams)
cbridgha: pmc_approved? (raghunathan.srinivasan)
cbridgha: pmc_approved? (naci.dai)
cbridgha: pmc_approved? (deboer)
neil.hauge: pmc_approved+
cbridgha: pmc_approved? (kaloyan)
cbridgha: pmc_approved? (cbridgha)
ccc: review+
cbridgha: review+
Target Milestone: 3.4 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC
Attachments:
Description Flags
NPE Validation for WTP ccc: iplog+

Description Galileo Perez CLA 2011-12-15 15:19:51 EST
Build Identifier: I20111209-2100

Using an adopter product over eclipse 4.2 and WTP 3.4 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-12-15 15:38:33 EST
Created attachment 208470 [details]
NPE Validation for WTP

Solves the problem about EJB Wizard now showing up

Related to Bug 364090 and Bug 363973.
Comment 2 Carl Anderson CLA 2012-05-14 16:25:50 EDT
Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such.

This is requested by an adopter, IBM.  This bug keeps us from accessing the EJB Project wizard in the scenario mentioned in comment #1.

Is there a work-around? If so, why do you believe the work-around is insufficient? 

There is no workaround- in this scenario, the EJB Project wizard will not appear.

How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added?

The Java EE JUnit bucket has been run against this fix.

Give a brief technical overview. Who has reviewed this fix? 

Currently, the code assumes that if a server supports Enterprise Applications, it supports all of the Java EE module types.  That is not always the case, so further checks are added to ensure that the runtime supports the correct project facet.

What is the risk associated with this fix?

This is a somewhat low risk fix- it only adds additional checking to ensure proper runtime support of the desired facet.
Comment 3 Carl Anderson CLA 2012-05-16 23:33:27 EDT
Committed to HEAD for WTP 3.4.0 RC1