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.
OSGi is a fundamental element in the technology stack of AEM. It is used to control the composite bundles of AEM and their configuration. OSGi “provides the standardized primitives that allow applications to be constructed from small, reusable and collaborative components.
These configurations are made by creating sling:OsgiConfig nodes in the repository for the system to reference. These nodes mirror the OSGi configurations, and form a user interface to them. To update the configuration data you update the node properties.
Which OSGi configuration settings take over precedence on start-up? Repository nodes with type sling:OsgiConfig under /apps/*/config configuration settings take over precedence on start-up.
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:
/apps/*/config
, be it property files or JCR nodes with the node jcr:primaryType
of sling:OsgiConfig
sling:OsgiConfig
under /libs/*/config
, these are OOTB definitions for components that come with AEM.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:
sling:OsgiConfig
node you just createdconfigMgr
, find the relevant service and Delete the configuration.sling:OsgiConfig
node (I usually keep those in a CRX package that I can simply reinstall)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With