Use the editCompUnit command to select
a composition unit that contains an enterprise OSGi application, and
update the composition unit so that the business-level application
uses the newer configuration. If any of the updates contain configuration options, run the editCompUnit command a second time to update the configuration information. You can also take the opportunity to make additional, non-essential configuration changes.
About this task
An OSGi composition unit consists of an EBA asset, (optionally) one or more composite bundle extensions, and configuration information for running the asset and composite bundle extensions in a business-level application. The configuration information can include HTTP session management, context roots, virtual hosts, security roles, run-as roles, and web application or Blueprint resource reference bindings for your OSGi application.
When all bundle downloads are complete, you can update the OSGi composition unit so that the business-level application uses the newer configuration. If any of the updates contain configuration options, run the editCompUnit command a second time to update the configuration information. You can also take the opportunity to make additional, non-essential configuration changes.For transitioning users: In the WebSphere® Application Server Version 7 Feature Pack for OSGi Applications and Java™ Persistence API 2.0, bundle changes to the asset are applied by restarting the business-level application, rather than by updating the composition unit. The current approach means that many bundle changes can be applied in place, without restarting the running business-level application. See the following troubleshooting tip: The behavior has changed for using wsadmin commands to update bundle versions.
Procedure
- Check
the update
status of the composition unit.
There are four distinct deployment statuses for an OSGi composition unit:- Using latest OSGi application deployment.
- New OSGi application deployment not yet available because it requires
bundles that are still downloading.
- New OSGi application deployment available.
- New OSGi application deployment cannot be applied because bundle
downloads have failed.
- Update the composition unit to use the latest version of the EBA asset or composite bundle extension.
If the status is
"New OSGi application deployment available",
open a wsadmin command prompt then run the following jython command:
AdminTask.editCompUnit('[
-blaID WebSphere:blaname=bla_name
-cuID WebSphere:cuname=cu_name
-CompUnitStatusStep [[asset_name.eba true]]
]')
For example:
AdminTask.editCompUnit('[
-blaId WebSphere:blaname=test.app
-cuId WebSphere:cuname=com.ibm.ws.eba.extension.componenttest_0001.eba
-CompUnitStatusStep [[com.ibm.ws.eba.extension.componenttest.eba true]]
]')
- If you make bundle changes
that require configuration changes
to the composition unit, you must update the configuration
information for running the asset in the business-level application.
For example, if you update a bundle in an EBA asset, or replace a composite bundle extension, you might introduce a resource that requires additional configuration, such as a new or changed Blueprint resource reference, or security role mapping.
If any of the updates contain configuration options, run the editCompUnit command a second time to update the configuration information. You can also take the opportunity to make additional, non-essential configuration changes. See Modifying the configuration of an OSGi composition unit using wsadmin commands.
CAUTION:
If
you omit this step, then when you save your changes,
the application will fail to restart.
- Save your changes to the master configuration.
To save your configuration changes, use the following command:
AdminConfig.save()
Results
When you save the changes to the composition unit, the associated business-level application is updated to use the new configuration. If the business-level application is running, the bundle and configuration updates are applied immediately. If possible (that is, depending on the nature of the updates) the system applies the updates without restarting the application. If you update a bundle that provides only OSGi services to the rest of the application, then only that bundle is restarted. If you update a bundle that provides one or more packages to other bundles, then those bundles and any bundles to which they provide packages are restarted. If, however, a new package or service dependency is added, or an existing package or service dependency is removed, then the application is restarted; a newly added package and service can come from a newly-provisioned bundle, or from a bundle that has already been provisioned. Messages relating to any restart operations are written to the WebSphere Application Server SystemOut.log file.