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 > >
