DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Jasper Siepkes
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus AccessPlatform

Tighten import constraints of DataNucleus OSGi bundles.

Created: 20/Jan/10 11:25 AM   Updated: 14/Jun/11 12:23 PM   Resolved: 14/Jun/11 12:21 PM
Component/s: None
Affects Version/s: 2.0.0.release
Fix Version/s: 3.0.0.m5

 Description  « Hide
The imports of the DataNucleus OSGi bundles do currently not specify version constraints. For example javax.transaction is imported as:

javax.transaction;resolution:=optional, javax.transaction.xa;resolutio

This means import version 0.0.0. Normally this shouldn't be a problem since OSGi will look for the bundle who exports those packages with the highest version (in the case of javax.transaction probably version 1.1.0). Unless there is a bundle present which actually exports version 0.0.0. Now javax.transaction is by default not present in the Java 5 JRE, but it is present in the Java 6 JRE. So far this shouldn't be a problem because no bundle exports these JRE packages in a default OSGi environment.

However for the DataNucleus plugin system you need the Eclipse registry bundles and 'org.eclipse.core.runtime' does reexport all these packages with their version 0.0.0. And this is the crux of the story, other bundles besides DataNucleus specify javax.transaction with its version (1.1.0) and get the javax.transaction package from the javax.transaction bundle but DataNucleus doesn't specify a version and gets the package from the JRE.

In the Eclipse community they call it 'the ever present evil of the org.eclipse.core.runtime's use of re-export for the org.eclipse.osgi bundle'. See . So while this is probably more of an Eclipse issue then a DataNucleus issue, having version constraints on OSGi imports is also good practice.

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 25/Jan/10 10:49 AM
When you've time why not provide a patch for datanucleus-core/datanucleus-rdbms/datanucleus-jpa MANIFEST.MF files and they can be looked at when someone has time.

Jasper Siepkes added a comment - 26/Jan/10 08:37 PM
Will do! Give me a couple of days to make some time for it.

Andy Jefferson added a comment - 28/May/10 08:28 AM
SVN trunk has min versions on JDO (javax.jdo.*) and JPA (javax.persistence.*) now.

Andy Jefferson added a comment - 14/Jun/11 12:21 PM
Marking as fixed since has been open too long with no input, and we do restrict on some dependencies now. If requiring others then please raise a new issue on the plugin in question and attach a patch