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

Bug 345499

Summary: An NPE generating a Client JAR for an EJB project without Enterprise Beans
Product: [WebTools] WTP EJB Tools Reporter: Israel Gomez Delgado <israelgd>
Component: jst.ejbAssignee: Carl Anderson <ccc>
Status: RESOLVED FIXED QA Contact: Kaloyan Raev <kaloyan>
Severity: normal    
Priority: P2 CC: cbridgha, ccc, israelgd, neil.hauge, shr31223, stryker
Version: 3.2.2Flags: kaloyan: pmc_approved? (david_williams)
kaloyan: pmc_approved? (raghunathan.srinivasan)
kaloyan: pmc_approved? (naci.dai)
kaloyan: pmc_approved? (deboer)
neil.hauge: pmc_approved+
kaloyan: pmc_approved? (kaloyan)
kaloyan: pmc_approved? (cbridgha)
cbridgha: review+
stryker: review+
kaloyan: review+
Target Milestone: 3.3 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC_approved
Bug Depends on:    
Bug Blocks: 347698    
Attachments:
Description Flags
proposed patch which includes a simple validation. kaloyan: iplog+

Description Israel Gomez Delgado CLA 2011-05-11 16:37:59 EDT
Build Identifier: 

Steps to reproduce:

1.- Create an  3.0 or 3.1 EJB project, add it to an EAR,  uncheck  the "Create an EJB client JAr module ...." option.
2.- In the EE, right click on the EJB project and go to Java EE > Create EJB Client Jar
3.- Finish the wizard, and you will get an error dialog with  the following stack traces:



java.lang.NullPointerException
at org.eclipse.jst.j2ee.internal.ejb.archiveoperations.EJBClientJarCreationHelper.getFilesToMove(EJBClientJarCreationHelper.java:102)
at org.eclipse.jst.j2ee.internal.ejb.archiveoperations.EjbClientJarCreationOperation.execute(EjbClientJarCreationOperation.java:177)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl$1.run(DataModelPausibleOperationImpl.java:385)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:410)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:360)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.doExecute(DataModelPausibleOperationImpl.java:247)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.executeImpl(DataModelPausibleOperationImpl.java:219)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.cacheThreadAndContinue(DataModelPausibleOperationImpl.java:89)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.execute(DataModelPausibleOperationImpl.java:207)
at org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard$1CatchThrowableRunnableWithProgress.run(DataModelWizard.java:225)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1008)
at org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard.runOperations(DataModelWizard.java:234)
at org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard.performFinish(DataModelWizard.java:191)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:811)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:430)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.jst.ejb.ui.internal.actions.EJBClientCreationAction.primRun(EJBClientCreationAction.java:72)
at org.eclipse.jst.j2ee.internal.actions.BaseAction.run(BaseAction.java:59)
at org.eclipse.jst.j2ee.internal.actions.BaseAction.run(BaseAction.java:119)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
at org.eclipse.equinox.launcher.Main.main(Main.java:1384)

And Reproducible on an Adopter.

Reproducible: Always
Comment 1 Israel Gomez Delgado CLA 2011-05-11 16:46:46 EDT
Created attachment 195432 [details]
proposed patch which includes a simple validation.

tested on the adopter and works fine.
Comment 2 Rob Stryker CLA 2011-05-12 00:44:02 EDT
The patch looks safe (simple NPE check) and can possibly be squeezed into RC1. Chuck?

    * 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. 

   The NPE destroys the stack and prematurely terminates the operation that creates EJB Clients. 

    * Is there a work-around? If so, why do you believe the work-around is insufficient? 
 
   There is no workaround that I've seen. 

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

   The patch was tested by an adopter who has assured us it works properly. There is no JUnit for this fix. 

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

   The fix is a simple null check, which prevents the stack from being blown away and the operation from failing prematurely. I (Rob Stryker) have reviewed the patch.
 
    * What is the risk associated with this fix? 

   The patch seems very safe.
Comment 3 Carl Anderson CLA 2011-05-13 10:28:54 EDT
This is EJB Tools code, not Java EE Tools
Comment 4 Carl Anderson CLA 2011-05-13 10:33:49 EDT
The adopter that this effects, IBM, would also like this backported to R3_2_maintenance once WTP 3.2.5 development begins.
Comment 5 Chuck Bridgham CLA 2011-05-17 09:51:16 EDT
approve
Comment 6 Kaloyan Raev CLA 2011-05-18 09:33:59 EDT
Raising for PMC approval. See comment #2.
Comment 7 Carl Anderson CLA 2011-05-18 14:10:38 EDT
Committed to HEAD for WTP 3.3 RC2