Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365349

Summary: EJB project mapped to WEB-INF/lib of web project is imported as utility project
Product: [WebTools] WTP Java EE Tools Reporter: Salvador Zalapa <zalapa>
Component: jst.j2eeAssignee: Salvador Zalapa <zalapa>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: ccc, shr31223
Version: unspecifiedFlags: cbridgha: review+
ccc: review+
Target Milestone: 3.2.5 P   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 366644    
Attachments:
Description Flags
EAR sample
none
Patch
none
Second version patch shr31223: iplog+

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