You are right again, spring-context which my bundle depends on has the following line in its manifest import
javax.annotation;resolution:=optional;version=0, Thanks again -Dan On Sat, Mar 12, 2011 at 7:36 PM, David Jencks <[email protected]> wrote: > I suspect that spring was loading the javax.annotation classes from the > framework and activemq was supplying them from the geronimo bundle so spring > didn't recognize them as the same class. Once you removed the possibility of > spring loading them from the framework, both spring and activemq loaded them > from the geronimo bundle. > > I wish there were standards for versions for jdk provided packages... would > make life much easier. > > thanks > david jencks > > On Mar 12, 2011, at 7:13 PM, Dan Tran wrote: > >> Hi David, >> >> I am using java6, geronimo-annotation_1.0_spec-1.1.1.jar ( same >> version that activemq uses ) >> >> further search ( activemq javax.annotation issue ) leads me to >> http://njbartlett.name/2011/02/09/uses-constraints.html >> >> and you are right, remove etc/jre.properties's java6's >> javax.annotation* solves the issue. >> >> However, what went wrong? why my @Resource, @PostConstruct, etc muted >> when my bundles depend on geronimo-annotation_1.0_spec-1.1.1.jar >> >> Thanks for the quick answser >> >> >> -Dan >> >> I am still learning to walk the OSGI way. :-) >> >> >> On Sat, Mar 12, 2011 at 5:47 PM, David Jencks <[email protected]> wrote: >>> Which jdk? >>> Which geronimo-annotation_1.???_spec? >>> which version of the geronimo-annotation spec? >>> >>> Getting this right is tricky since the java 6 jdks come with the 1.0 >>> javax.annotation classes and javaee 6 needs the 1.1 annotation classes. >>> >>> Usually the framework is going to be exporting the classes at version >>> 0.0.0.0 (no version specified). If something like spring imports without a >>> version specification it will get it from the jdk/framework bundle whereas >>> stuff that imports with a version will get it from the geronimo bundle. >>> >>> You might try removing javax.annotation* from the appropriate bit of >>> jre.properties. >>> >>> thanks >>> david jencks >>> >>> On Mar 12, 2011, at 4:18 PM, Dan Tran wrote: >>> >>>> Hi I have a very simple spring power bundle which uses @PostContruct >>>> and @PreDestroy. The bundle is built with bundlor-maven-plugin. It >>>> works fine at initial try. >>>> >>>> Then, I add java.annotation's version to the manifest ( >>>> bundlor-maven-plugin complains about the mising version). Deploy again >>>> with geronimo-annotation's bundle. The PostContruct and PreDestroy >>>> stops working. >>>> >>>> Kara 2.2 does not complain about bundle, every thing looks good. >>>> >>>> Is there a workaround? This prevents me from deploying and use >>>> activemq client ( which also uses geronimo-annotation ) >>>> >>>> This sounds likes a very fundamental problem, but I am not able to >>>> find any existing similar issue yet >>>> >>>> Big thanks ahead. >>>> >>>> -Dan >>> >>> > >
