Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370856 - On Java EE project creation the JRE class path entry is generated without the execution enviroment ID (e.g. "JavaSE-1.7").
Summary: On Java EE project creation the JRE class path entry is generated without the...
Status: RESOLVED INVALID
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: Faceted Project Framework (show other bugs)
Version: 3.3.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: wst.common CLA
QA Contact: Konstantin Komissarchik CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-07 12:34 EST by Dimo Stoilov CLA
Modified: 2012-02-09 11:52 EST (History)
1 user (show)

See Also:
konstantin: review-
kaloyan: review? (ccc)


Attachments
proposed patch (1.79 KB, patch)
2012-02-07 12:54 EST, Dimo Stoilov CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimo Stoilov CLA 2012-02-07 12:34:03 EST
This results in missing "Bundle-RequiredExecutionEnvironment" manifest header when installing OSGI bundle facet (Libra). This happens in case a runtime is chosen for the project. 

Details:
(1) in case you choose runtime you have not the execution enviroment ID:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre7">
(2) in case you do not choose runtime (choose "none") you have it - "JavaSE-1.7":
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">

Impact - missing "Bundle-RequiredExecutionEnvironment" header:
When the project is migrated to plugin project. PDE searches for this ID in the JRE class path entry and sets its value for the "Bundle-RequiredExecutionEnvironment" header. However if such ID is not found like it is in (2) no Bundle-RequiredExecutionEnvironment header is set.
Comment 1 Dimo Stoilov CLA 2012-02-07 12:54:08 EST
Created attachment 210670 [details]
proposed patch

The reason for the difference between (1) and (2) is: in (1) the JRE class path is set via the java facet delegate, and in (2) this is done by the org.eclipse.jst.common.project.facet.core.internal.StandardJreClasspathProvider in, and in a different way from the java facet delegate.

The proposed fix is in StandardJreClasspathProvider and sets the classpath entry in the same way like it is done in the java facet delegate.
Comment 2 Kaloyan Raev CLA 2012-02-08 11:18:59 EST
Carl, Konstantin, could you review this patch for 3.3.2?
Comment 3 Konstantin Komissarchik CLA 2012-02-09 11:52:25 EST
The difference in these two cases is intentional. When user targets a runtime, they are targeting a specific instance of a JVM (not just a particular version). When they don't target a specific runtime, we are free to apply a more generic specification based on facet version.

I would recommend pursuing a fix to PDE import procedure instead. There is no reason that their import couldn't be smarter and actually analyze the referenced JRE.