| Summary: | ADD_TO_EAR property is blocking the EJB Client Jar generation | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP EJB Tools | Reporter: | Zina Mostafia <zina> | ||||||
| Component: | jst.ejb | Assignee: | Carl Anderson <ccc> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Kaloyan Raev <kaloyan> | ||||||
| Severity: | enhancement | ||||||||
| Priority: | P3 | CC: | cbridgha, ccc, makandre, shr31223 | ||||||
| Version: | 3.2 | Flags: | ccc:
pmc_approved?
(david_williams) ccc: pmc_approved? (raghunathan.srinivasan) ccc: pmc_approved? (naci.dai) ccc: pmc_approved? (deboer) ccc: pmc_approved? (neil.hauge) ccc: pmc_approved? (kaloyan) cbridgha: pmc_approved+ kaloyan: review+ |
||||||
| Target Milestone: | 3.3.2 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | PMC_Approved | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 366621 | ||||||||
| Attachments: |
|
||||||||
Created attachment 208013 [details]
Add an "ALLOW_EJB_CLIENT" flag
This seems like the smallest change we could make to support this scenario. All this does is allow the EJB Client properties to be enabled if the ALLOW_EJB_CLIENT data model flag is set.
Created attachment 208031 [details]
Add and "ALLOW_EJB_CLIENT" flag (v2)
Slightly modified patch. I did some minor changes, and also changed EjbFacetPostInstallDelegate to allow creating the EJB client project even if the EJB project is not in an EAR.
I am OK with this change. However, it looks to me more like an enhancement than a bugfix. So, if you want to commit this in the maintenance stream, please get a PMC approval too. Seeking PMC approval to introduce an enhancement into a maintenance stream. 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. Is there a work-around? If so, why do you believe the work-around is insufficient? Currently, there is no way for an adopter to reuse our EJB Client jar project creation support outside of an EAR project. The workaround would be to rewrite the WTP data models and wizards. 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 hand and the Java EE JUnit bucket has been run against it. Give a brief technical overview. Who has reviewed this fix? A new flag has been added to the data model to allow adopters to programmatically enable the EJB Client jar project support in the data models and operation without requiring an EAR project. Since the default for the flag is false, this will not effect current WTP behavior. Carl and Kaloyan have reviewed Roberto's fix. What is the risk associated with this fix? The risk is low- the same behavior that exists today will continue, unless an adopter programmatically changes this flag. approved. allowing the use of this operation within another programming model. Existing behavior is unchanged Committed to R3_3_maintenance and HEAD for WTP 3.3.2 and WTP 3.4.0 M5 |
I need to generate an EJB project, and an EJB Client jar project. But I do not want to add the result to an EAR. I have a different containing application that contains both my EJB and EJB Client projects. The property IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR need to be set to false. This would disable the page where a user can select to generate an EJB Client Jar. We tried to set IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR to true, to enable the UI, and then set it to false only when the user selects to Finish, but that did not work either. Because the underneath Code blocks the EJB Client generation if the IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR is set to false (not only the UI is blocked). The following code snippet in the EjbFacetInstallDataModelProvider class propertySet() method is just the tip of the problem: } else if (propertyName.equals(ADD_TO_EAR)) { boolean addToEar = (Boolean) propertyValue; if (!addToEar && isPropertySet(CREATE_CLIENT)) { model.setBooleanProperty(CREATE_CLIENT, false); // create client disabled! } else { If we leave the IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR to true, the wizard would finish and generates an EAR project , and this is not what we need. Seems this property is used for a double purpose. It actually means a creation of an EAR project and it is used to enable the EJB Client generation. Now we either have no Client jar generation , or we have to end up with an EAR getting generated in the workspace. We need to decouple these two logic with two separate flags. Suggest to add a new flag like ADD_TO_APPLICATION, which does not imply creation of an application, but means that the project would be part of an application.