Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367910 - EjbClientProjectCreationOperation fails creating EJB client if the project does not have target runtime
Summary: EjbClientProjectCreationOperation fails creating EJB client if the project do...
Status: RESOLVED FIXED
Alias: None
Product: WTP EJB Tools
Classification: WebTools
Component: jst.ejb (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3.2   Edit
Assignee: Roberto Sanchez Herrera CLA
QA Contact: Kaloyan Raev CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-04 20:14 EST by Roberto Sanchez Herrera CLA
Modified: 2012-01-11 10:44 EST (History)
0 users

See Also:
kaloyan: review+


Attachments
Patch for 3.3.2 and 3.4 (1.88 KB, patch)
2012-01-04 20:18 EST, Roberto Sanchez Herrera CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.