Administering bundles in the internal bundle repository using wsadmin commands

Use wsadmin commands to list, add, remove, or show further details for bundles and composite bundles that are held in the bundle repository that is included in the product.

Before you begin

You can administer bundles and composite bundles in the internal bundle repository by using wsadmin commands as described in this topic, or by using the administrative console as described in Administering bundles in the internal bundle repository.

About this task

WebSphere® Application Server includes an internal bundle repository, in which you can store the bundles and composite bundles for your OSGi applications.

If your OSGi applications are configured to expect to find certain bundles in the internal bundle repository, you must add those bundles to the repository. Composite bundles can either be included directly in your applications, or provisioned from the internal bundle repository or from an external repository that can process composite bundles. If your bundle includes Blueprint XML files that specify service or reference elements, and the bundle is included in an EBA asset or installed in the internal bundle repository, then these elements are respected during provisioning and appropriate services are provisioned when needed. For more information, see Provisioning for OSGi applications.

You can install bundles singly, or you can install a set of bundles packaged as a compressed archive file with a .zip file extension. In both cases, the bundles are available individually in the repository. If you install a composite bundle in a bundle repository, and the composite bundle includes bundles by reference, you must ensure that the referenced bundles are also available in the same repository. If you use the internal bundle repository, and the composite bundle directly contains bundles, the contained bundles are not listed separately and are only available as part of the composite bundle. For more information, see Composite bundles.

You can list, add, remove, or show further details for bundles and composite bundles that are held in the internal bundle repository.

Procedure

  • List all bundles and composite bundles that are held in the internal bundle repository.
    Use the listLocalRepositoryBundles command. For example:
    AdminTask.listLocalRepositoryBundles()

    For more information, see listLocalRepositoryBundles command.

    Notes:
    • The list includes any bundles that you have added since you last saved your changes, and excludes any bundles that you have removed since you last saved your changes.
    • The output from this command is formatted so that you can copy the list of bundles, then paste them into the removeLocalRepositoryBundles command.
  • Add a bundle, composite bundle or grouped-up set of bundles to the internal bundle repository.
    Use the addLocalRepositoryBundle command. For example:
    AdminTask.addLocalRepositoryBundle('-file path')
    Each individual bundle must be packaged as a .jar file, and must contain a suitably-configured bundle manifest file. Each composite bundle must be packaged as a compressed archive file with a .cba file extension, and must contain a suitably-configured composite bundle manifest file. Each grouped-up set of bundles must be packaged as a compressed archive file with a .zip file extension.

    For more information, see addLocalRepositoryBundle command.

  • Remove one or more bundles or composite bundles from the internal bundle repository.
    Use the removeLocalRepositoryBundle or removeLocalRepositoryBundles command. For example:
    AdminTask.removeLocalRepositoryBundle('-symbolicName bundle_symbolic_name 
                                           -version bundle_version')
    AdminTask.removeLocalRepositoryBundles([
        'bundle1_symbolic_name;bundle1_version
         bundle2_symbolic_name;bundle2_version
         bundle3_symbolic_name;bundle3_version
        '
    ])
    Notes:
    • The output from the listLocalRepositoryBundles command is formatted so that you can copy the list of bundles, then paste them into the removeLocalRepositoryBundles command.
    • You cannot remove composite bundles at the same time as you remove any bundles that they reference. You must first remove the composite bundles, then run the removeLocalRepositoryBundles command a second time to remove the referenced bundles.

    For more information, see removeLocalRepositoryBundle command and removeLocalRepositoryBundles command.

  • Show further details (for example, imported packages, exported packages, and required bundles) for a bundle or composite bundle in the internal bundle repository.
    Use the showLocalRepositoryBundle command. For example:
    AdminTask.showLocalRepositoryBundle('-symbolicName bundle_symbolic_name 
                                         -version bundle_version')

    For more information, see showExternalBundleRepository command.

What to do next