Community
Participate
Working Groups
Build Identifier: 20110204-0611 jpa project wizard fails to set the target rt for ear Reproducible: Always Steps to Reproduce: - launch JPA project wizard - pick enterprise server (Ex: Glassfish/WebLogic server) - check "add project to an EAR" and finish - on ear project | properties, check "Target Runtime" Target RT selection is missing. i see following exception in the log file: org.eclipse.core.runtime.CoreException: Cannot modify faceted project from within a facet delegate. at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.beginModific ation(FacetedProject.java:1380) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.access$0(Fac etedProject.java:1366) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject$3.run(Facete dProject.java:642) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.setTargetedR untimes(FacetedProject.java:656) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.setRuntime(F acetedProject.java:583) at org.eclipse.jst.j2ee.project.facet.J2EEFacetRuntimeChangedDelegate.updateProje ctRuntime(J2EEFacetRuntimeChangedDelegate.java:266) at org.eclipse.jst.j2ee.project.facet.J2EEFacetRuntimeChangedDelegate.updateProje ctRuntime(J2EEFacetRuntimeChangedDelegate.java:286) at org.eclipse.jst.j2ee.project.facet.EarFacetRuntimeHandler.updateModuleProjectR untime(EarFacetRuntimeHandler.java:58) at org.eclipse.jst.j2ee.application.internal.operations.AddComponentToEnterpriseA pplicationOp.updateModuleRuntimes(AddComponentToEnterpriseApplicationOp.java:3 36) at org.eclipse.jst.j2ee.application.internal.operations.AddComponentToEnterpriseA pplicationOp.execute(AddComponentToEnterpriseApplicationOp.java:85) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperatio nImpl$1.run(DataModelPausibleOperationImpl.java:385) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperatio nImpl.runOperation(DataModelPausibleOperationImpl.java:410) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperatio nImpl.runOperation(DataModelPausibleOperationImpl.java:360) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperatio nImpl.doExecute(DataModelPausibleOperationImpl.java:247) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperatio nImpl.executeImpl(DataModelPausibleOperationImpl.java:219) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperatio nImpl.cacheThreadAndContinue(DataModelPausibleOperationImpl.java:89) at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperatio nImpl.execute(DataModelPausibleOperationImpl.java:207) at org.eclipse.jst.j2ee.project.facet.J2EEFacetInstallDelegate.addToEar(J2EEFacet InstallDelegate.java:173) at org.eclipse.jst.j2ee.project.facet.J2EEFacetInstallDelegate.installAndAddModul etoEAR(J2EEFacetInstallDelegate.java:207) at org.eclipse.jst.j2ee.project.facet.UtilityFacetPostInstallDelegate.execute(Uti lityFacetPostInstallDelegate.java:41) at org.eclipse.wst.common.project.facet.core.events.internal.LegacyEventHandlerAd apter.handleEvent(LegacyEventHandlerAdapter.java:69) at org.eclipse.wst.common.project.facet.core.events.internal.ProjectListenerRegis try.notifyListeners(ProjectListenerRegistry.java:76) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.notifyListen ers(FacetedProject.java:1328) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modifyIntern al(FacetedProject.java:455) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChanges Internal(FacetedProject.java:1182) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.access$2(Fac etedProject.java:1118) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject$5.run(Facete dProject.java:1100) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChanges (FacetedProject.java:1110) at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.c ommitChanges(FacetedProjectWorkingCopy.java:2020) at org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.performFini sh(ModifyFacetedProjectWizard.java:400) at org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard.perform Finish(NewProjectDataModelFacetWizard.java:282) at org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard$3.run(Modif yFacetedProjectWizard.java:331) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) at org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard$4.run(Modif yFacetedProjectWizard.java:345) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.j ava:121)
Please forward to Java EE tools if you think that's where this bug belong, but Ram has indicated that this problem does not exist in the Web project wizard.
Found in Indigo M5.
Created attachment 195553 [details] proposed patch Problem was that when adding to an ear, the module facet data model needed to have its runtime set. It wasn't enough to have the JPA facet data model runtime set. The wizard still has the annoying behavior of resetting your previously set facets when setting a runtime, but I've tested this in a number of different orders and conditions, and there is no exception and the ear's runtime is accurately set.
* 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 an adopter requested fix which results in a EAR that cannot be deployed. * Is there a work-around? If so, why do you believe the work-around is insufficient? Workaround is to go into the EAR properties and manually set the Target Runtime * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? The fix has been tested by Paul and myself. JUnit tests have been run. * Give a brief technical overview. Who has reviewed this fix? See comment #3. I have reviewed the fix * What is the risk associated with this fix? Risk is low, fix is isolated.
committed for rc1