Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cross-project-issues-dev] Issues with javax.annotation bundles

I don't believe there's any action required, but I thought I would report this here in case any other project uses javax.annotation.

javax.annotation 1.1 was recently added to Orbit (to be consumed by Virgo, which is not in Indigo I believe).  Because of a difference in the manifest, however, it cannot be used currently with the Eclipse 4.1 SDK (which uses javax.annotation 1.0).  The javax.annotation package (1.0) was introduced in java 1.6, and javax.annotation (1.1) is in java 7.  When we picked up javax.annotation 1.1 bundle as part of our build we found that some bundles wired themselves to the javax.annotation in the JRE_LIB and other bundles wired themselves to javax.annotation 1.1, which in our case prevented contribution initialize code to be run (for some subset of bundles :-)

I believe the first level of fix (for us) is to only ever use Import-Package for javax.annotation packages (it's a split package in OSGi, and if you pick require-bundle you get wired up based on bundle dependency order, etc).

We're also considering specifically requiring javax.annotation [1.0.0,1.1.0) for use with Eclipse 4.  The javax.annotation bundle is not a singleton and in theory multiple bundles can exist in the same installation at the same time (how also being provided by the JRE_LIB effects this I do not know).

If the above doesn't make any sense, you probably don't have to worry about it :-) Please feel free to discuss on our bugs:

Fixing this in Eclipse 4:
Bug 348123 - Annotation @PostConstruct not found by injector

Discussion about how javax.annotation 1.1 should interact with the system in general:
Bug 348155 - Possible interactions with new javax.annotation 1.1.0


Paul Webster
Hi floor.  Make me a sammich! - GIR

Back to the top