[AIX HP-UX Linux Solaris Windows][z/OS]

Deploying OSGi applications that use SCA

You can deploy OSGi and Service Component Architecture (SCA) applications to servers or clusters as assets, which you add to a business-level application by creating composition units.

Before you begin

This topic assumes that the Feature Pack for SCA is at service level 1.0.1.5 or later.

This also topic assumes that you have already created an OSGi application packaged as an enterprise bundle archive (EBA) file and an SCA composite definition packaged as a Java archive (JAR) file.

An SCA composite packaged with a Web archive (WAR) file cannot use the implementation.osgiapp component.

About this task

To deploy an OSGi application that uses SCA, create a business-level application that includes the EBA and SCA assets. You can use the administrative console or wsadmin commands to create the business-level application, import the EBA file and SCA composite as assets, and then add the EBA and SCA assets as composition units to the business-level application.

An EBA composition unit consists of the imported asset (the EBA file), plus any configuration information for the OSGi application context roots, virtual hosts, and resource bindings.

For implementation.osgiapp, the component implementation value for the composition unit is the application symbolic name and version.

The following deployment restrictions apply to EBA files:

For information about these and other restrictions, see the topic on multiple SCA implementation packaging considerations.

Procedure

  1. Create a business-level application.
    Table 1. Ways to create SCA business-level applications. You can create a business-level application that has OSGi and SCA assets using the administrative console or wsadmin scripts.
    Option Method
    Administrative console business-level application creation wizard Click Applications > New Application > New Business Level Application and follow instructions in the wizard.

    For example use of the console to create a business-level application that has an SCA asset, see Example: Creating an SCA business-level application with the console.

    wsadmin scripts Use the createEmptyBLA, importAsset, and addCompUnit commands to create the business-level application.

    For example use of scripting to create a business-level application that has an SCA asset, see Example: Creating an SCA business-level application with scripting.

  2. Import OSGi, SCA, or other assets needed by your business-level application.
  3. Add the EBA asset as a composition unit to the business-level application.

    You must add the EBA asset before the SCA asset that references it.

  4. Add the SCA asset as a composition unit to the business-level application.

    Do not change the starting weight value of the OSGi or SCA composition unit, if that change gives the OSGi composition unit a higher starting weight than the SCA composition unit. By default, the product assigns the SCA composition unit a higher starting weight value than the value for the OSGi composition unit. When using implementation.osgiapp, the SCA composition unit must start after the referenced OSGi composition unit starts. Thus, the SCA composition unit must have a higher starting weight value than the OSGi composition unit. If you override the default values and set a higher starting weight value for the OSGi composition unit than for the SCA composition unit, the business-level application does not start.

    In a Network Deployment environment, target the OSGi composition unit to the same server as the SCA composition unit.

    Avoid trouble Avoid trouble: If a validation error occurs when adding the SCA asset, saying that a service is not found, ensure that the following conditions exist:
    • The service name matches the name of a blueprint service
    • The Blueprint service uses the services.exported.interfaces property to export its interface
    • The interface is included in the Application-ExportService header of the application manifest
    The absence of these conditions can cause the validation error. The error resembles the following:
    com.ibm.wsspi.management.bla.op.OpExecutionException: CWSAM0105E: 
    The following Service Component Architecture (SCA) Validation errors caused the 
    CreateScaCodeGen step to fail:
      Service not found for component service: 
       Component = HelloWorldComponent Service = helloWorld
    gotcha

Results

The business-level application has OSGi and SCA composition units. You can now start the business-level application.

If the ServiceRuntimeException Unable to access OSGi application framework occurs when starting the business-level application, ensure that the SCA composition unit has a higher starting weight than the EBA composition unit.

If the ServiceRuntimeException Unable to obtain service service from application occurs, check SystemOut.log and SystemErr.log files for messages from the Blueprint container indicating that the run time cannot start the Blueprint service.

If the java.lang.TypeNotPresentException occurs when starting the business-level application, a bundle that uses one of the supported SCA annotations is not importing the org.osoa.sca.annotations package. Update the bundle manifest to import this package.

What to do next

If you must delete a composition unit from the business-level application, delete the SCA composition unit before attempting to delete the EBA composition unit, otherwise the product returns an error. An EBA composition unit that provides the implementation cannot be deleted until the SCA composition unit that uses the implementation.osgiapp is deleted.




In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic Task topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Jun 12, 2013 3:32:32 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v700osgijpa&product=was-nd-mp&topic=tsca_osgi_deploy
File name: tsca_osgi_deploy.html