2 Replies Latest reply on Aug 27, 2011 4:05 PM by Barry Hathaway

    Starting bundle ignores exports

    Barry Hathaway Newbie

      I'm trying to install an updated version of javax.xml.ws into ServiceMix ESB 4.4

      with the command:

       

      osgi:install wrap:mvn:javax.xml.ws/jaxws-api/2.2.5\$Bundle-Version=2.2.5&Export-Package=*\;version="2.2.5"

       

      The bundle gets installed OK with the web console saying:

       

      Exported Packages javax.xml.ws,version=2.2.5

      javax.xml.ws.handler,version=2.2.5

      javax.xml.ws.handler.soap,version=2.2.5

      javax.xml.ws.http,version=2.2.5

      javax.xml.ws.soap,version=2.2.5

      javax.xml.ws.spi,version=2.2.5

      javax.xml.ws.spi.http,version=2.2.5

      javax.xml.ws.wsaddressing,version=2.2.5

       

      The problem is that when I start the bundle the exports disappear. Both the web console and

      packages:exports show that nothing is exported.

       

      Any ideas?

      Thanks.

       

      Barry Hathaway

        • 1. Re: Starting bundle ignores exports
          Freeman(Yue) Fang Master

          Hi,

           

          I tried it and with osgi:headers I can see the export package is actually there

           

          osgi:headers 217

           

          wrap_mvn_javax.xml.ws_jaxws-api_2.2.5_Bundle-Version_2.2.5_Export-Package___version_2.2.5 (217)

          -


          Specification-Title = Java API for XML Web Services

          Specification-Version = 2.2

          Tool = Bnd-0.0.357

          Generated-By-Ops4j-Pax-From = wrap:mvn:javax.xml.ws/jaxws-api/2.2.5$Bundle-Version=2.2.5&Export-Package=*;version=2.2.5

          Implementation-Vendor-Id = com.sun

          Created-By = 1.6.0_24 (Apple Inc.)

          Implementation-Title = Java API for XML Web Services Standard Implementation

          Manifest-Version = 1.0

          Bnd-LastModified = 1314413741274

          Originally-Created-By = 1.5.0_12-b04 (Sun Microsystems Inc.)

          Ant-Version = Apache Ant 1.7.0

          Extension-Name = javax.xml.ws

          Implementation-Vendor = Sun Microsystems, Inc.

           

          Bundle-Name = wrap_mvn_javax.xml.ws_jaxws-api_2.2.5_Bundle-Version_2.2.5_Export-Package___version_2.2.5

          Bundle-SymbolicName = wrap_mvn_javax.xml.ws_jaxws-api_2.2.5_Bundle-Version_2.2.5_Export-Package___version_2.2.5

          Bundle-Version = 2.2.5

          Bundle-ManifestVersion = 2

           

          Import-Package =

               javax.xml.bind;resolution:=optional,

               javax.xml.bind.annotation;resolution:=optional,

               javax.xml.namespace;resolution:=optional,

               javax.xml.soap;resolution:=optional,

               javax.xml.transform;resolution:=optional,

               javax.xml.transform.stream;resolution:=optional,

               javax.xml.ws;resolution:=optional;version=2.2,

               javax.xml.ws.handler;resolution:=optional;version=2.2,

               javax.xml.ws.handler.soap;resolution:=optional;version=2.2,

               javax.xml.ws.http;resolution:=optional;version=2.2,

               javax.xml.ws.soap;resolution:=optional;version=2.2,

               javax.xml.ws.spi;resolution:=optional;version=2.2,

               javax.xml.ws.spi.http;resolution:=optional;version=2.2,

               javax.xml.ws.wsaddressing;resolution:=optional;version=2.2,

               org.w3c.dom;resolution:=optional

          Export-Package =

               javax.xml.ws.handler;uses:="javax.xml.ws,javax.xml.namespace";version=2.2.5,

               javax.xml.ws.http;uses:=javax.xml.ws;version=2.2.5,

               javax.xml.ws.spi;

                    uses:="javax.xml.ws,

                         javax.xml.ws.wsaddressing,

                         javax.xml.transform,

                         org.w3c.dom,

                         javax.xml.namespace,

                         javax.xml.ws.handler,

                         javax.xml.bind";

                    version=2.2.5,

               javax.xml.ws.handler.soap;uses:="javax.xml.ws.handler,javax.xml.namespace,javax.xml.soap,javax.xml.bind";version=2.2.5,

               javax.xml.ws.wsaddressing;

                    uses:="javax.xml.bind.annotation,

                         javax.xml.namespace,

                         org.w3c.dom,

                         javax.xml.transform,

                         javax.xml.bind,

                         javax.xml.ws,

                         javax.xml.ws.spi";

                    version=2.2.5,

               javax.xml.ws.spi.http;version=2.2.5,

               javax.xml.ws;

                    uses:="javax.xml.ws.handler,

                         javax.xml.ws.spi,

                         javax.xml.ws.spi.http,

                         javax.xml.transform,

                         org.w3c.dom,

                         javax.xml.bind.annotation,

                         javax.xml.transform.stream,

                         javax.xml.bind,

                         javax.xml.namespace";

                    version=2.2.5,

               javax.xml.ws.soap;uses:="javax.xml.ws.spi,javax.xml.ws,javax.xml.soap";version=2.2.5

           

          Not really sure why packages:exports doesn't work, I guess it's something related to the way you use wrap handler, we don't recommend to use wrap handler in production, though can use it in fast prototype, we recommend to use maven-bundle-plugin to wrap the jar which isn't OSGi friendly, just like we do here[1]

           

          https://svn.apache.org/repos/asf/servicemix/smx4/bundles/trunk/jaxb-impl-2.2.1/

           

          Freeman

          • 2. Re: Starting bundle ignores exports
            Barry Hathaway Newbie

            I actually shutdown ServiceMix and restarted it and the new bundle was resolved.

            Then I started it and the javax.xml.ws package was exported just fine. It is as if

            the install didn't really complete until the reboot.  Not sure why.