Network Deployment (Distributed operating systems), v8.0 > Administer applications and their environment > Administer OSGi applications > Update bundle versions for an EBA asset


Update 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. We can use the editAsset command to configure the deployed asset to use an updated version of any bundle or composite bundle used by the asset. We can choose to use a specific bundle version, or to pull in the latest compatible version.


Before you begin

We can update bundle and composite bundle versions for an EBA asset by using wsadmin as described in this topic, or by using the administrative console as described in Update 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 the application as an asset, you can no longer change the direct contents of the asset.

To update bundles and composite bundles 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:

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

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

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 transitioning users: In the WAS v7 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.

    We 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 Check the update status of an OSGi composition unit. This status is one of the following values:

    • Use 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 transitioning users: In the WAS v7 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 v8, 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 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 using wsadmin.sh.

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

  3. Save your changes to the master configuration.

    To save the 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 Check the update status of an OSGi composition unit.

Parent topic: Update bundle versions for an EBA asset

Related concepts:

About OSGi Applications
Enterprise bundle archives
Enterprise bundle archive update
Application bundles, use bundles and provision bundles
Bundle and package versioning
Provisioning for OSGi applications

Related tasks:

Secure OSGi Applications

Related reference:

OSGi Applications: Troubleshooting tips

Related information:

Preview bundle versions update [Settings]
Update bundle versions in this application [Settings]
Task topic Feedback
Copyright IBM Corporation 2009, 2011. All Rights Reserved.
This information center is powered by Eclipse technology.

+

Search Tips   |   Advanced Search