Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340247 - jpa project wizard fails to set the target rt for ear
Summary: jpa project wizard fails to set the target rt for ear
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.0 RC2   Edit
Assignee: Paul Fullbright CLA
QA Contact:
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-16 17:19 EDT by Ram Venkataswamy CLA
Modified: 2011-05-23 19:28 EDT (History)
3 users (show)

See Also:
david_williams: pmc_approved+
neil.hauge: pmc_approved? (raghunathan.srinivasan)
neil.hauge: pmc_approved? (naci.dai)
neil.hauge: pmc_approved? (deboer)
neil.hauge: pmc_approved? (neil.hauge)
neil.hauge: pmc_approved? (kaloyan)
neil.hauge: pmc_approved? (cbridgha)
neil.hauge: review+


Attachments
proposed patch (2.83 KB, patch)
2011-05-12 19:13 EDT, Paul Fullbright CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ram Venkataswamy CLA 2011-03-16 17:19:59 EDT
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)
Comment 1 Konstantin Komissarchik CLA 2011-03-16 18:01:01 EDT
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.
Comment 2 Konstantin Komissarchik CLA 2011-03-16 18:01:26 EDT
Found in Indigo M5.
Comment 3 Paul Fullbright CLA 2011-05-12 19:13:44 EDT
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.
Comment 4 Neil Hauge CLA 2011-05-13 17:47:34 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 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.
Comment 5 Paul Fullbright CLA 2011-05-16 17:40:17 EDT
committed for rc1