Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365349 - EJB project mapped to WEB-INF/lib of web project is imported as utility project
Summary: EJB project mapped to WEB-INF/lib of web project is imported as utility project
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.5 P   Edit
Assignee: Salvador Zalapa CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 366644
  Show dependency tree
 
Reported: 2011-12-01 13:39 EST by Salvador Zalapa CLA
Modified: 2012-01-03 11:33 EST (History)
2 users (show)

See Also:
cbridgha: review+
ccc: review+


Attachments
EAR sample (1.68 KB, application/octet-stream)
2011-12-01 13:41 EST, Salvador Zalapa CLA
no flags Details
Patch (4.26 KB, patch)
2011-12-01 13:42 EST, Salvador Zalapa CLA
no flags Details | Diff
Second version patch (3.54 KB, patch)
2011-12-07 15:33 EST, Salvador Zalapa CLA
shr31223: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Salvador Zalapa CLA 2011-12-01 13:39:39 EST
Build Identifier: 3.2.5

Since EJBs in WAS is part of the EJB 3.1 specification, a EJB project mapped to WEB-INF/lib is a valid scenario, however when EJB jar if the EJB jar is imported as project, it is as Utility project instead of an EJB project.

Reproducible: Always

Steps to Reproduce:
1.Import the attached EAR file. Import the EJB as project.
2.Check the facets of the project EJB project. You will see the project is an utility project.
Comment 1 Salvador Zalapa CLA 2011-12-01 13:41:35 EST
Created attachment 207805 [details]
EAR sample
Comment 2 Salvador Zalapa CLA 2011-12-01 13:42:57 EST
Created attachment 207806 [details]
Patch
Comment 3 Chuck Bridgham CLA 2011-12-07 13:17:55 EST
approved
Comment 4 Carl Anderson CLA 2011-12-07 14:34:54 EST
Chava, this works in the development environment, but will fail to compile in the build, since org.eclipse.jst.j2ee.web cannot prereq org.eclipse.jst.j2ee.ejb.  Please replace the usage of EJBComponentImportDataModelProvider with something along the lines of:

if (EarModuleManager.hasEJBModuleExtension())
{
localModel = EarModuleManager.getEJBModuleExtension().createImportDataModel();
}
else // just treat it like a utility
{
localModel = DataModelFactory.createDataModel(new J2EEUtilityJarImportDataModelProvider());
}

That alleviates the need for the dependency on the EJB plugin.
Comment 5 Salvador Zalapa CLA 2011-12-07 15:33:45 EST
Created attachment 208068 [details]
Second version patch
Comment 6 Salvador Zalapa CLA 2011-12-07 15:34:12 EST
Attaching a new version patch.
Comment 7 Chuck Bridgham CLA 2011-12-07 15:59:03 EST
thanks looks better
Comment 8 Roberto Sanchez Herrera CLA 2012-01-03 11:33:25 EST
Code committed to R3_2_5_patches. Resolving bug