Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324881 - New project wizard, when choosing "Add project to an EAR", user selected facets get unselected
Summary: New project wizard, when choosing "Add project to an EAR", user selected face...
Status: NEW
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: jst.j2ee CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-09 13:52 EDT by Paul Fullbright CLA
Modified: 2012-05-01 16:14 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Fullbright CLA 2010-09-09 13:52:50 EDT
Process:

- Create an EAR without a runtime selected. (Only one, so that it is the default EAR project)
- Launch new EJB project wizard. Enter name. Default version for me is 3.0; it may be necessary to create a 3.0 EJB project first so that this is the default.
- Open facets dialog, add JPA facet. OK.
- Choose "Add project to an EAR".  There is a validation message that an EAR project already exists at this location.  (which in itself is likely a bug)
- Touch the EAR project name dropdown without selecting anything.  At this moment, the JPA facet is removed, and the EJB facet version is changed to 3.1.

This seems wrong to me.  Once I've added a facet, the wizard should not be removing it, even if the new target runtime (determined by the runtime of the now resolved EAR project) has a different set of "default" facets.  There should be a validation message instead, I would think.
Comment 1 Paul Fullbright CLA 2010-09-09 13:54:08 EDT
I should note that I'm doing this in head code.
Comment 2 Paul Fullbright CLA 2010-09-09 13:56:25 EDT
Or perhaps instead of just setting the list of facets to be the default facets for that runtime, only new facets that are default for that runtime should be added, with existing facets and versions left untouched.
Comment 3 Carl Anderson CLA 2010-10-15 16:56:27 EDT
Assigning to Jason Sholl for initial investigation.
Comment 4 Carl Anderson CLA 2012-05-01 15:52:02 EDT
Konstantin- this appears to be related to interaction with the facets.
Comment 5 Konstantin Komissarchik CLA 2012-05-01 16:14:55 EDT
> Konstantin- this appears to be related to interaction with the facets.

Depends on what you mean by interaction, but this doesn't appear to be a framework issue. The logic for what to do when user selects an EAR is in Java EE Tools code. 

Based on what I recall of these discussions from years ago, the described behavior is as designed. There were some strong feelings about resetting facets in this case.