Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are the Configurations made in OSGi Console saved?

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.

like image 440
Skeptic Scribbler Avatar asked Feb 20 '17 08:02

Skeptic Scribbler


People also ask

What is OSGi configuration?

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.

Which property is used to define OSGi configurations in the repository?

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 startup?

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.


1 Answers

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)
like image 115
toniedzwiedz Avatar answered Sep 22 '22 23:09

toniedzwiedz