WASdev/sample.osgi.blueprint-cm

Name: sample.osgi.blueprint-cm

Owner: WASdev

Description: Demonstrating blueprint-cm enablement in Liberty

Created: 2015-05-28 14:55:30.0

Updated: 2016-02-07 03:29:16.0

Pushed: 2015-06-11 12:11:24.0

Homepage: null

Size: 172

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

sample.osgi.blueprint-cm

This sample demonstrates the use of Config Admin and custom Blueprint namespace handlers in OSGi applications on the Liberty profile. I blogged about these capabilities in September 2014 when they were new out in beta. Everything demonstrated in this sample will be fully supported in the upcoming June 26th 2015 release of WebSphere Application Server V8.5.5.6 Liberty Profile.

The sample illustrates the use of the following things, all in an OSGi application running on Liberty:

This readme file focuses on how to install and test the sample. A separate article will provide a broader overview of the sample and its purpose.

The sample comprises a single OSGi application, checked into Git as a set of Eclipse projects. Three projects correspond to OSGi bundles; the fourth aggregates those bundles into an OSGi application. The sample can be run from inside Eclipse once four open source bundles have been downloaded and imported into the Eclipse workspace.

  1. Install a recent Eclipse driver. I've been using Eclipse Luna SR2. This version of Eclipse comes with built-in Git support.

  2. Install the WebSphere Application Server Development Tools (WDT) into Eclipse via https://eclipse.org/downloads/

  3. Window > Preferences > Server > Runtime Environments > Add > WebSphere Application Server V8.5 Liberty Profile. Download a new runtime or reuse an existing one.

  4. Create a new server: New > Server > WebSphere Application Server V8.5 Liberty Profile

  5. Download the four bundles listed below. The simplest place to get them is Maven Central. It's probably ok to use later versions, but the links are to the level of each bundle that I've used in developing and testing the sample.

  6. org.apache.felix.configadmin 1.8.4

  7. slf4j.api 1.7.12

  8. slf4j.jdk14 1.7.12

  9. org.apache.aries.blueprint.cm 1.0.6

  10. Load them into Eclipse: File > Import > OSGi Bundle or Fragment. Select the WebSphere Application Server Liberty Profile with SPI target runtime.

  11. git clone https://github.com/WASdev/sample.osgi.blueprint-cm. File > Import > Existing projects into workspace. Pull in:

  12. test.blueprint.cm.basic - Blueprint-managed beans

  13. test.bp.cm.eba - OSGi application

  14. test.custom.ns.handler - custom Blueprint namespace handler provider

  15. test.wab.frontEnd - a simple web interface to drive the test

  16. Create a new Server. In the 'Servers' view, right click > New > Server > WebSphere Application Server Liberty Profile.

  17. Double click the 'Server Configuration' and add these features:

  18. wab-1.0

  19. jndi-1.0

  20. Run the test! In the enterprise explorer view, test.wab.frontEnd > WebContent > index.html. Right click > Run As > Run on Server. Select the Liberty server and add the test.bp.cm.eba to the server. This should launch a web browser with a simple form in. Fill in some values (anything will do) and click 'Send'. Check the 'Console' view to see various results in the messages.log.

Again, please see the associated article for more information on what this sample is showing.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.