Where are the Configurations made in OSGi Console saved?
Asked Answered
S

2

9

When we update any configuration for a component in the Configurations tab in the Apache Felix Web OSGi Console, where are these configuration settings saved? This is with respect to AEM 6.0 or above.

Salsala answered 20/2, 2017 at 8:25 Comment(0)
A
14

The manually saved configuration settings are stored in the the crx-quickstart/launchpad/config directory (in your AEM installation folder in the local file system) and, on top of that, as .config files in the Content Respository at /apps/system/config.

For example, if you're looking for the configuration of com.example.MyComponent, you can find it as a text file in crx-quickstart/launchpad/config/com/example/MyComponent.config (in the local file system) and at /apps/system/config/com.example.MyComponent.config inside your Content Repository.

The files at these two locations are updated when you change the settings manually in the OSGi console.

In AEM you can also store configuration in JCR nodes of the type sling:OsgiConfig. These will not be created or updated when you manually save the config but they offer a neat way of managing configuration as content.

When AEM looks for the configuration, the following order of resolution is used:

  1. nodes under /apps/*/config, be it property files or JCR nodes with the node jcr:primaryType of sling:OsgiConfig
  2. nodes with type sling:OsgiConfig under /libs/*/config, these are OOTB definitions for components that come with AEM
  3. .config files from <aem-installation-directory>/crx-quickstart/launchpad/config/ on the local file system.

Depending on the OSGi configuration of Apache Sling JCR Installer, the sling:OsgiConfig nodes can be written back to when you manually change the config. There's also a number of settings affecting the lookup of said configurations so it's a good idea to familiarise oneself with this config.

Please check out the official documentation for more comprehensive information.

If you're trying to get a config stored in a sling:OsgiConfig node to work as expected and you're unsure if another config for the same service has been cached somewhere, here's a sequence of steps that has worked for me consistently in AEM 6.4:

  1. Delete the sling:OsgiConfig node you just created
  2. Go to the Felix console's configMgr, find the relevant service and Delete the configuration.
  3. Recreate the sling:OsgiConfig node (I usually keep those in a CRX package that I can simply reinstall)
Aeri answered 20/2, 2017 at 9:14 Comment(0)
L
1

The configurations are stored by the felix configadmin bundle inside the felix bundle cache. Not sure where this cache is located in AEM. In Apache Karaf the configs in my case are in:

data/cache/bundle7/date/config

Where bundle id 7 is the id of the configadmin bundle.

Lenzi answered 20/2, 2017 at 8:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.