3 Replies Latest reply on Feb 16, 2013 3:52 AM by davsclaus

    fuse esb cannot start installed OSGi bundle

    wl880504

      I want to create a OSGi bundle which can be deployed with fuse esb from a jar file. I got floodlight.jar in target folder with ant build. I have tested the floodlight.jar with:

               java -jar floodlight.jar

      It runs good.

       

      Then create a OSGi bundle from floodlight.jar with bnd:

               java -jar bnd.jar wrap floodlight.jar

      this results a OSGi bundle named floodlight.bar.

       

      Then I manually deploy it at FUSE ESB console.

               karaf@root> osgi:install -s file:/home/user/Dir/to/floodlight.bar

      Got bundle ID: 255

               karaf@root> osgi:list

               [[ 255]] [[Active]] [[ 60]] floodlight (0)

      The problem is that the bundle is installed, but cannot get started. I have used > osgi:start 255, but got no response. Any one can help me with it?

        • 1. Re: fuse esb cannot start installed OSGi bundle
          iocanel

          Using osgi:install with the -s option will start your bundle once it gets installed.

           

          The you see in the osgi:list means that your bundle is started.

          • 2. Re: fuse esb cannot start installed OSGi bundle
            wl880504

            I have question about BundleActivator interface. If I want the bundle to do something, like java -jar floodlight.jar, once it is started. Do I need to implement the BundleAcitvator? So it behaves like running from the main() method.

            Right now I did not implement BundleActivator.  It behaves like a library once started.

            • 3. Re: fuse esb cannot start installed OSGi bundle
              davsclaus

              Yes if you need any business logic to start when the bundle starts you need to either

              - use BundleActivator

              - a spring xml file

              - a blueprint xml file

               

              The latter two is special for Karaf / SMX / FuseESB as they detect these xml files and start the application accordingly.

               

              You can mix and match and have both a bundle activator and xml files as well.