Update bundle versions for an EBA asset using the editAsset command
After you import the 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 used by the asset. You can choose to use a specific bundle version, or to pull in the latest compatible version.
You can update bundle and composite bundle versions for an EBA asset by using wsadmin commands as described in this topic, or using the administrative console as described in Update bundle versions for an EBA asset.
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, we can no longer change the direct contents of the asset. To update bundles and composite bundles that are specified in an asset, we 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 the EBA asset we 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 the selections for other bundles is used.
After we make the 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.
You 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 containing the asset.
For users who are moving from a previous version: In the WAS 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.
- 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:
- 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.
- 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 WAS 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 ompUnitStatusStep 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] ]]')
- 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 we want the system to choose a bundle version for you. If we 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 (AdminTask) wsadmin.
After we make the 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.
- Save the 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 we 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.
Parent topic: Update bundle versions for an EBA asset
Related concepts
Enterprise bundle archives Enterprise bundle archive update Application bundles, use bundles and provision bundles Bundle and package versioning Provisioning for OSGi applications
Related information:
Preview bundle versions update [Settings] Update bundle versions in this application [Settings]