Where are the Configurations made in OSGi Console saved?

一笑奈何 提交于 2019-12-06 04:47:38

问题


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.


回答1:


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)



回答2:


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.



来源:https://stackoverflow.com/questions/42339618/where-are-the-configurations-made-in-osgi-console-saved

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!