1 Reply Latest reply on Jan 30, 2014 9:22 AM by 616e

    FAB resolution - javax.annotation 0.0.0 - spring-data-jpa - unresolved import

    616e

      Hi,

      given this pom:

       

      <project.....>

         .....

          <groupId>com.my.test</groupId>
          <artifactId>my-test</artifactId>
          <version>1.0.0-TEST</version>
          <name>A Test</name>

       

          <packaging>jar</packaging>

       

          <dependencies>
              <dependency>
                  <groupId>org.springframework.data</groupId>
                  <artifactId>spring-data-jpa</artifactId>
                  <version>1.4.3.RELEASE</version>
              </dependency>
          </dependencies>

       

      </project>

       

      and this FAB install

       

      install fab:mvn:com.my.test/my-test/1.0.0-TEST

       

      plus an additional install of

       

      install mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsr305/2.0.2_1

       

      (which provides javax.annotation.concurrent)

      the my-test package is installed, but cannot be started, the following error is given:

       

      start 234
      Error executing command: Error starting bundles:
          Unable to start bundle 234: Unresolved constraint in bundle com.my.test.my-test [234]: Unable to resolve 234.0: missing requirement [234.0] osgi.wiring.package; (&(osgi.wiring.package=javax.annotation)(version>=1.3.9)(!(version>=2.0.0)))

       

      Examining the osgi:headers of my bundle shows:

       

      .......

      Import-Package =

         .......

          javax.annotation;version="[1.3.9,2)",

         .......

       

      Which is actually not available, an exports | grep javax.annotation tells:

       

           0 javax.annotation; version=1.1.0

          ......

       

      (this does not come from the jsr305 bundle, it's 1.1.0 in a fresh fuse installation)

       

      Looking into the created bundle

       

      ${FUSEFOLDER}/data/cache/bundle234/version0.0/bundle.jar

       

      there is contained within this jar

       

      org.springframework.data.spring-data-jpa.jar

       

      which is the only jar that contains in it's MANIFEST.MF a reference to javax.annotation:

       

      Import-Package: ........

               javax.annotation;version="0.0.0",........

              ........

       

      So my question is: where does the version range "[1.3.9,2)" come from, which is used in the created MANIFEST.MF?

      What else might be wrong?


      Thanks in advance,

      Andreas

        • 1. Re: FAB resolution - javax.annotation 0.0.0 - spring-data-jpa - unresolved import
          616e

          Update

           

          I tried the following. I unpacked the spring-data-jpa.jar in the local .m2/repository, removed the

          javax.annotation entry from the Import-Package, recreated a jar and repeated the above

          install procedure: same effect!

           

          So, it seems, the javax.annotation dependency is created out of thin air, and unrelated

          to the spring-data-jpa.jar. But: if I remove the dependency to spring-data-jpa.jar from

          the pom, the problem vanishes.