3 Replies Latest reply on May 20, 2011 11:44 AM by sdahl

    ManagedService fails to register

    sdahl

      I am building an example ManagedService and using a BundleActivator to start the service. However, the bundle header does not show the bundle-activator and the start method is never called. There are no errors or exceptions when the bundle is installed using osgi:install -s mvn:com.mycompany/managed-service-example/1.0.0-SNAPSHOT.

      I am using apache-servicemix-4.3.1-fuse-01-09.

       

      Here is the manifest:

      Manifest-Version: 1.0

      Export-Package: mycompany.service;uses:="mycompany.logging,org.osgi.

      framework,org.osgi.service.cm"

      Built-By: sdahl

      Tool: Bnd-1.15.0

      Bundle-Name: MyCompany :: Sample managed service

      Created-By: Apache Maven Bundle Plugin

      Bundle-Vendor: MyCompany

      Build-Jdk: 1.6.0_24

      Bundle-Version: 1.0.0.SNAPSHOT

      Bnd-LastModified: 1305826046010

      Bundle-ManifestVersion: 2

      Bundle-Activator: mycompany.service.ManagedServiceActivator

      Bundle-Description: This managed service uses config admin to dynamica

      lly change config at run time.

      Import-Package: mycompany.logging,org.apache.log4j.spi;version="[1.2.

      16,1.3)",org.osgi.framework;version="[1.5,2)",org.osgi.service.cm;ver

      sion="[1.3,2)"

      Bundle-SymbolicName: mycompany.managed-service-example

       

       

      Will someone please let me know what I'm missing?

       

      Thanks for your help!

      Sandi

       

      Edited by: sdahl on May 19, 2011 6:27 PM

        • 1. Re: ManagedService fails to register
          ffang

          Hi,

          A quick question, is your customer bundle status is "Active"? And there's no any exception even in the log?

           

          Freeman

          • 2. Re: ManagedService fails to register
            sdahl

            Yes, the status is active and there are no messages, errors or otherwise.

             

            In the meantime, I was able to get the bundle running inside eclipse and the start method is being called and the bundle registered as a managed service. Interesting that the same bundle has different behavior running in Fuse ESB and an OSGI Framework run configuration in eclipse...

            • 3. Re: ManagedService fails to register
              sdahl

              I just did an uninstall and clean install of bundle and it now registering as a managed service with start being called. Not sure if it is because I did a fresh install rather than an update (even though I check the header it the bundle appeared to be updated) or because I changed the pom file slightly to use maven-scr-plugin: