Deploying an OSGi application as a business-level application

Import an OSGi application as an enterprise bundle archive (EBA) asset, then add the asset to a business-level application by creating an EBA composition unit.

Before you begin

This topic assumes that you have already created an OSGi application packaged as an enterprise bundle archive (EBA) file, for example as described in Creating an OSGi application.

About this task

To deploy an OSGi application in WebSphere® Application Server, you import your OSGi application (EBA file) as an asset and create an empty business-level application. You then add a composition unit to the business-level application. This composition unit consists of the new EBA asset plus configuration information for the context roots, virtual hosts, security role mappings, and web module or Blueprint resource bindings for your OSGi application.
Note:
  • An EBA file can be imported into only one asset.
  • An EBA asset can be added to only one business-level application.
A business-level application is scoped to cell scope, so this means that only one instance of a given OSGi application can be deployed in a cell.

This topic describes the specific task of deploying an OSGi application as a business-level application. The more generalized task of creating a business-level application, and adding assets and other artifacts to the business-level application in the form of a composition unit, is described in Creating business-level applications.

Each step can be performed using either the administrative console or wsadmin commands. You can also create an empty business-level application or add a composition unit using programming.

Procedure

  1. Import the EBA file as an asset.
    Note: You can import the asset before or after you create the empty business-level application. An EBA file can be imported into only one asset.

    To import the EBA file using the administrative console, navigate to Applications > New Application > New Asset. For more information, see Importing assets.

    To import the EBA file using the importAsset command, enter (for example) the following command:
    AdminTask.importAsset(["-storageType", "FULL", "-source", com.ibm.ws.eba.helloWorldService.eba])
    For more information, see the step "Import assets to your configuration" in topic Setting up business-level applications using wsadmin scripting.
    Notes:
    • When you import the EBA file as an asset, it is checked for any bundle dependencies. If the OSGi application has dependencies on bundles that are not included in the EBA file, the dependencies are resolved against any configured bundle repositories. Asset registration cannot complete unless all missing dependencies are available from configured bundle repositories.
    • When asset registration completes, if the asset requires bundles to be downloaded from bundle repositories, a warning message is displayed telling you to save your changes to the master configuration after completing the asset import. When you save changes, the missing dependencies are downloaded from the configured bundle repositories.
    • If the asset uses Java™ 2 security, the security permissions are displayed. This information comes from the META-INF/permissions.perm file for your application. For more information, see Java 2 security and OSGi Applications.
    • Do not add the asset to a business-level application until the bundle download has completed. You can view the bundle download status of the asset from the administrative console by navigating to Applications > Application Types > Assets > asset_name, or by calling the areAllDownloadsComplete () method of the BundleCacheManager MBean.
  2. Create an empty business-level application.

    To create an empty business-level application using the administrative console, navigate to Applications > New Application > New Business Level Application. For more information, see the step "Create an empty business-level application" in topic Creating business-level applications with the console.

    To create an empty business-level application using the createEmptyBLA command, enter (for example) the following command:
    AdminTask.createEmptyBLA('[-name "helloWorld" -description "helloWorld OSGi sample"]')
    For more information, see the step "Create an empty business-level application" in topic Setting up business-level applications using wsadmin scripting.

    To create an empty business-level application using programming, see Creating an empty business-level application using programming.

  3. Add the asset to the business-level application as an EBA composition unit.
    An EBA asset can be added to only one business-level application. An EBA composition unit consists of a previously-imported EBA asset, plus some or all of the following configuration information:
    • Mappings from the composition unit to a target application server, web server or cluster.
    • Configuration of the application's context roots or virtual hosts.
    • Bindings to any associated web modules or blueprint resource references.
    • Mappings from security roles to particular users or groups.
  4. Save your changes to the master configuration.
    If you are using wsadmin commands, enter the following command:
    AdminConfig.save()

What to do next

You are now ready to start your business-level application.

Icon that indicates the topic type Task topic

Terms and conditions for information centers | Feedback


Timestamp icon Last updated: Saturday, 20 October 2012
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v700osgijpa&product=was-nd-mp&topic=thread_ta_dev_deployapp

Copyright IBM Corporation 2009, 2012.
This information center is powered by Eclipse technology. (http://www.eclipse.org)