2 Replies Latest reply on Apr 15, 2013 5:20 PM by joshna_r

    Jboss Bundle start order and Bundle start issues

    joshna_r

      I am trying to deploy some OSGI bundles  which use blueprint xml in Jboss EAP 6 and i am facing issues with bundles start order and bundles starting.

       

      I have 3 osgi bundles blueprint-api.jar , blueprint-server.jar and blueprint-client.jar

       

      api has just a  interface HelloWorld.java

      server has implementation HelloWorldService implements HelloWorld

      client has blueprintxml and client bean to reference the HelloWorld service that is registered

       

      blueprint-server.jar uses blueprint xml to register the service  and blueprint-client.jar also uses blueprint xml to access this service

       

      During startup of jboss i am seeing 2 behaviours

       

      Behaviour 1 : blueprint-server.jar bundle is started , but blueprint-client.jar is never started.

       

      I had to go jboss web console and manually start this bundle.

       

      Is this the behaviour of jboss. Doesn't it start bundles by itself . Do we have to manually start them

       

      Behaviour 2 : blueprint-client.jar is trying to start and shows following message and never starts any of the deployed bundles.

       

      17:57:32,680 INFO  [org.apache.aries.blueprint.container.BlueprintContainerImpl] (Blueprint Extender: 1) Bundle org.apache.aries.samples.blueprint.helloworld.client is waiting for dependencies [(objectClass=org.apache.aries.samples.blueprint.helloworld.api.HelloWorldService)]

       

      Why does jboss bundle starting order varies on restarts. Can we configure bundles startup order anywhere.

       

      Am i missing anything. Is there any configuration to makes bundles resolve and start correctly on server startup.

       

      i heard from my architect spring dm will load the dependencies first before starting client jar and starts all osgi bundles correctly. Should i try Spring DM for my use case.

       

      Any  help will be appreciated. 

       

      Thank you

      -joshna

        • 1. Re: Jboss Bundle start order and Bundle start issues
          thomas.diesler

          JBoss makes a best effort approach when resolving/starting an OSGi bundle. As part of the deployment process we attempt to resolve the bundle, if that works we also start the bundle, if that fails we roll back the deployment.

          If a bundle deployment cannot get resolved, which is perfectly fine, we defer resolution until we have an external trigger (i.e. an explicit management operation)

           

          On restart, user bundles should get resolved together up until the target start level. Have a look at the debug log.

           

          To have control over start ordering, you can work with start levels or make you bundles capabilities in the configuration. By doing the latter, they become part of the subsystem configuration and start order is completely defined and happens before any user bundle deployment can come in.

          • 2. Re: Jboss Bundle start order and Bundle start issues
            joshna_r

            Thanks for your reply . I am planning to script the bunde startup  using jboss-cli.

             

            Adding them as capabilities sound interesting , i will give that a try in my free time