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

Bug 367910

Summary: EjbClientProjectCreationOperation fails creating EJB client if the project does not have target runtime
Product: [WebTools] WTP EJB Tools Reporter: Roberto Sanchez Herrera <shr31223>
Component: jst.ejbAssignee: Roberto Sanchez Herrera <shr31223>
Status: RESOLVED FIXED QA Contact: Kaloyan Raev <kaloyan>
Severity: normal    
Priority: P3 Flags: kaloyan: review+
Version: 3.3.1   
Target Milestone: 3.3.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch for 3.3.2 and 3.4 none

Description Roberto Sanchez Herrera CLA 2012-01-04 20:14:12 EST
In EjbClientProjectCreationOperation, the operation will fail if the project does not have target runtime. The code fails here:

//Ensure Java DM has latest supported version
			try {
				IProjectFacetVersion oldVersion = (IProjectFacetVersion) javadm.getProperty(IFacetDataModelProperties.FACET_VERSION);
				IProjectFacetVersion newVersion = JavaFacet.FACET.getLatestSupportedVersion(runtime);  <<<<<------ An exception is thrown here if runtime is null
				if (newVersion != null && (oldVersion == null || oldVersion.getVersionString().compareTo(newVersion.getVersionString()) < 0 || !runtime.supports(oldVersion))) {
					javadm.setProperty(IFacetDataModelProperties.FACET_VERSION, newVersion);
				}
			} catch (CoreException e) {
				ModulecorePlugin.logError(e);
			}
Comment 1 Roberto Sanchez Herrera CLA 2012-01-04 20:18:50 EST
Created attachment 209043 [details]
Patch for 3.3.2 and 3.4
Comment 2 Roberto Sanchez Herrera CLA 2012-01-11 10:44:26 EST
Code committed to R3_3_maintenance and HEAD for WTP 3.3.2 and 3.4. Resolving defect.