Updating bundle versions for an EBA asset using the editAsset command

After you import your OSGi application as an asset, newer versions of the bundles or composite bundles that the asset uses might become available. You can use the editAsset command to configure the deployed asset to use an updated version of any bundle or composite bundle that is used by the asset. You can choose to use a specific bundle version, or to pull in the latest compatible version.

Before you begin

You can update bundle and composite bundle versions for an EBA asset by using wsadmin commands as described in this topic, or by using the administrative console as described in Updating bundle versions for an EBA asset.

About this task

When you first create an OSGi application, each bundle and composite bundle in the application is either directly contained in the EBA file or pulled in by reference. After you import your application as an asset, you can no longer change the direct contents of the asset. To update bundles and composite bundles that are specified in an asset, you add the updated versions to a repository then apply the updates to the asset. The asset is not updated automatically when new bundle versions become available; it is up to you to decide if and when to update the asset.

For each bundle or composite bundle specified by your EBA asset you can select either of the following options:
  • Use a specific available bundle version.
  • Use any version. In this case, the latest available version that is compatible with your selections for other bundles is used.

After you make your selections for this asset, the system tries to resolve the changes you have requested, and shows you the results. When you have selected a working configuration, the bundle and composite bundle version updates for the asset are applied.

You cannot update bundles that are provisioned by the runtime environment.

Note: When an EBA asset is updated, the update does not automatically affect the running business-level application. To update the running application, you update the composition unit of the business-level application that contains the asset.
For users who are moving from a previous version: 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.

Procedure

  1. Check the current bundle download status for all bundles in this asset.

    If the asset has previously been updated, the bundle downloads for the previous update must have completed.

    You can use the editCompUnit wsadmin command to check the bundle download status for an asset. This command checks the status of the associated OSGi composition unit, as described in Checking the update status of an OSGi composition unit. This status is one of the following values:
    • 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.
    Wait until the bundle downloads for any previous update have completed.
  2. Choose the update bundle version preference for each bundle in this application.
    To select bundle versions for an EBA asset using the editAsset command, open a wsadmin command prompt then run the following jython command. Under the -UpdateAppContentVersions parameter, include an entry (that is, the bundle_name current_version and update_preference) for each bundle that is listed in the application manifest between the application content header and the use bundle header. Include every bundle, whether or not you are updating the bundle version.
    For users who are moving from a previous version: 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. In WebSphere Application Server Version 8.0 and later versions, these changes are applied by updating the composition unit. To enable the current approach, the UpdateAppContentVersionsStep parameter has been replaced with the UpdateAppContentVersions parameter, and instead of restarting the business-level application you run the editCompUnit command with the CompUnitStatusStep parameter. See the following troubleshooting tip: The behavior has changed for using wsadmin commands to update bundle versions.
    AdminTask.editAsset('[
      -assetID asset_name 
      -UpdateAppContentVersions [
        [bundle_1_name current_version update_preference]
        [bundle_2_name current_version update_preference]
        [bundle_3_name current_version update_preference]
        [bundle_4_name current_version update_preference]
        [bundle_5_name current_version update_preference]
      ]]')
    Notes:
    • current_version specifies either a bundle version number, for example 1.0.0, or NOT_DEPLOYED for shared bundles (that is, use bundles) that are declared in the application manifest but not deployed by the runtime environment. This argument describes the current configuration of the bundle, and is not used to change the configuration.
    • update_preference specifies the new bundle version preference. This is either a bundle version number, for example 1.0.0, or NOT_DEPLOYED for shared bundles, or NO_PREF if you want the system to choose a bundle version for you. If you do not want to update the version for a given bundle, set this attribute to the same value that you are using for the current_version attribute.

    For more information about using the editAsset command, see BLAManagement command group for the AdminTask object using wsadmin scripting.

    After you make your selections for this asset, the system tries to resolve the changes you have requested, and shows you the results. When you have selected a working configuration, the bundle and composite bundle version updates for the asset are applied.

  3. Save your changes to the configuration repository.

    To save your configuration changes, use the following command:

    AdminConfig.save()

    The bundle updates are downloaded.

What to do next

If you plan to update the composition unit at this time, check that all bundle downloads are complete. See Checking the update status of an OSGi composition unit.