Issue

While deploying new version of the osgi jar, the services/component configurations are bound with the old version of the jar instead of new one.   

Symptoms

You see one of the following messages in the log file:

  • *ERROR* [OsgiInstallerImpl] org.apache.felix.scr Cannot use configuration pid= for bundle jcrinstall: because it belongs to bundle jcrinstall:"

Solution

  1. Go to the configuration page at http://<host>:<port>/system/console/configMgr and select your component.
  2. Unlink the existing configuration by clicking unbind as shown in the snapshot below.
  3. Click OK in the confirmation dialog box.
  4. Edit and save the configuration.
Unbind

Best practice

To avoid this issue happening again in your continuous delivery process, the automated deployment script takes care of following things:

  • Always install from repository and do not mix match with installing directly from felix console.
  • New version bundles are added always and old version bundle are not deleted.
  • The package filter should include the jar path (/apps/<appname>/install/<bundleNamewithversion>.jar) and not mention the parent folder /apps/<appname>/install
  • If there is scenario that old bundle has to be deleted before deploying a new bundle, make sure after deleting the bundle and before installing new bundle below actions are in place
    1. Unbind the configuration.
    2. Refresh the packages at http://<host>:<port>/system/console/bundles.

Note:

If you have any questions or concerns about this issue, join the discussion at the forums Article to address unable to use configuration pid.

Additional information

When the bundle is first installed the configuration gets bound to the current location. When you update a bundle by uninstalling the old version and then installing the new version, the new install has a new different bundle location and hence the configuration cannot be used.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy