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 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. If a deployed OSGi application is to be extended using composite
bundles extensions, apply all extensions to the EBA composition unit
(cu) and update the OSGi application to the latest
deployment version. You must install all service import and exports
that are provided by composite bundle extensions before you can add
the SCA asset as a composition unit to a business-level application.
For information on using and deploying OSGi composite bundle extensions,
see the topic on extending a deployed OSGi application.
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:
- Import an
EBA file into only one asset.
- Add an EBA asset to only one
business-level application.
For information about these
and other restrictions, see the
topic on multiple SCA implementation packaging considerations.
Procedure
- 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 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.
|
- Import OSGi, SCA, or other assets needed by your
business-level
application.
- 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.
- Add the SCA
asset as a composition unit to the business-level
application.
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: 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.
New feature: This topic
references one or more of the application server log files. Beginning
in WebSphere Application Server Version 8.0 you can configure the
server to use the High Performance Extensible Logging (HPEL) log and
trace infrastructure instead of using
SystemOut.log ,
SystemErr.log,
trace.log,
and
activity.log files or native z/OS logging
facilities. If you are using HPEL, you can access all of your log
and trace information using the LogViewer command-line tool from your
server profile bin directory. See the information about using HPEL
to troubleshoot applications for more information on using HPEL.
newfeat
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.