Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
4 replies Latest Post - ‏2013-07-12T11:36:42Z by Ravi's page
Ravi's page
Ravi's page
12 Posts
ACCEPTED ANSWER

Pinned topic OSGI application development model in liberty profile

‏2013-06-28T03:55:24Z |

Hi All,

we are using osgi application development in liberty profile, I have few questions about development model to get maximum advantage of liberty profile

1) currently we are using maven bundle plugin (maven-bundle-plugin) to generate bundle from project, (not having METAINF file in source) then copy into bundleRepository. is hot deployment possible in this model? (i.e change the source code should reflect automatically)

2) is there any maven plugin for creating user features?

3) what is the preferred way to create user features for third party jars? (I want to create cxf and camel etc.. features)

  • Graham_Charters
    Graham_Charters
    14 Posts
    ACCEPTED ANSWER

    Re: OSGI application development model in liberty profile

    ‏2013-07-09T13:39:37Z  in response to Ravi's page
    Hi Ravi, sorry for not responding sooner.  
     
    1) There is no hot deploy or in-place update in Liberty.  If you are using the WebSphere Developer Tools (WDT), the tools will uninstall and re-install the application for you.  Since you're using Maven, I suspect you may not be using WDT.  Given we don't support your use case, would you be willing to raise an RFE detailing what you'd like supported (http://www.ibm.com/developerworks/rfe/)?
     
    2) You can use the esa-maven-plugin from Apache Aries.  The plugin has not been released yet, so you would need to check it out and build it from here: https://svn.apache.org/repos/asf/aries/trunk/esa-maven-plugin/, I've just written the documentation and posted it here: http://aries.apache.org/modules/esamavenpluginproject.html .  Please let me know if you spot any problems or have suggestions for improvements.
     
    3) CXF and Camel ship as OSGi bundles, which is a good start.  If you're deploying them as a user feature, then the trick will be getting any extenders (bundle trackers) or whiteboards (service trackers) to track and process the bundles that live inside the OSGi applications.  Trackers registered against the system bundle (bundle 0) see events for all bundles/service irrespective of whether they live inside an isolated application or not.  You can use this capability to receive all events and then filter out those which are for bundles outside your applications.  I've included a few useful links, below.  The second [2] touches on tracking Subsystems (these are the internal runtime view of an OSGi application).
     
     
     
    • Ravi's page
      Ravi's page
      12 Posts
      ACCEPTED ANSWER

      Re: OSGI application development model in liberty profile

      ‏2013-07-12T11:10:53Z  in response to Graham_Charters

      Hi Graham,

      Is ESA can contains jar (not bundles) files? if jar exist in ESA, feature installation is failing with Nullpointer exception. Currently we are using bundle plugin to convert jar to bundle first then ESA plugin to prepare esa file. 

      • Graham_Charters
        Graham_Charters
        14 Posts
        ACCEPTED ANSWER

        Re: OSGI application development model in liberty profile

        ‏2013-07-12T11:18:23Z  in response to Ravi's page

        Hi Ravi,

        An ESA can't contain plain old jars, they have to be bundles.  When building with maven, using the maven-bundle-plugin to create a bundle from a jar and then the esa-maven-plugin to create the ESA file is the direction I would take.

        Regards, Graham.

        • Ravi's page
          Ravi's page
          12 Posts
          ACCEPTED ANSWER

          Re: OSGI application development model in liberty profile

          ‏2013-07-12T11:36:42Z  in response to Graham_Charters

          Hi Graham,

          that's what we are doing now.. but I thought ESA can contains jars because Subsystem-Content has a attribute called type, which supports jar.