2 Replies Latest reply on Sep 10, 2011 5:01 AM by noosy

    OSGi bundle, javaee-api-6.0 library and javax.activation

    noosy

      Hi guys,

       

      I am new to Fuse ESB and OSGi. I have a fairly simple CXF JAXRS service which I am trying to deploy as a OSGi bundle to Fuse ESB.

       

      The service uses javax.activation.DataHandler and so my project includes the javaee-api-6.0 library. I am finding that on deployment I see the following error message:

       

      Error executing command: The bundle "myBundle " could not be resolved. Reason: Missing Constraint: Import-Package

      : javax.activation; version="[6.0.0,7.0.0)"

       

      This is causing me much grief.

       

      A couple of things I have noticed digging around:

       

      in /etc/jre.properties javax.activation is commented out. What is this about?

       

      Also, if I do:

       

      >packages:exports | grep activation

       

      in the shell, I see

       

          0 # javax.activation; version="0.0.0"

          88 javax.activation; version="1.1.0"

         178 org.apache.axiom.util.activation; version="0.0.0"

         178 org.apache.axiom.ext.activation; version="0.0.0"

       

      I'm not really clear what is going on but I think that although javax.activation is floating around in the container it isn't version [6.0.0,7.0.0) or basically a match for my dependency?

       

      Would love some guidance on best way to proceed and clarification on what is happening.

       

      Note that if I don't use a javax.activation.DataHandler in my service deploys fine and starts up.

       

      Thanks in advance.

        • 1. Re: OSGi bundle, javaee-api-6.0 library and javax.activation
          ffang

          Hi,

           

          What do you mean by "so my project includes the javaee-api-6.0 library"?

           

          Do you mean 1. you have javaee-api-6.0 dependency in pom or 2.your OSGi bundle embed the javaee-api-6.0.jar?

           

          You shouldn't embed javaee-api-6.0.jar nor  have javaee-api-6.0 dependency in pom, and in your pom.xml you can just

          use

           

          if you need use

          javax.activation.DataHandler.

           

          Btw, we have cxf-jaxrs example shipped with kit so you may need take a look.

           

          Freeman

          • 2. Re: OSGi bundle, javaee-api-6.0 library and javax.activation
            noosy

            I don't have the jee dependency in my pom but it appears as an indirect dependency in my NetBeans dependencies list. I'm not at work at the moment so I can't try anything til Monday but when I am back at work I will locate what dependency is using it and try and rid myself of it.

             

            Thanks.