0

Scenario: The same configuration parameter is present under /libs/*/config and /apps/*/config and modified in both locations as well as via Felix console.

And during run-time somehow Felix console configuration is taking precedence. How? My understanding is /apps should take precedence. Any views.

Rupesh
  • 2,627
  • 1
  • 28
  • 42

3 Answers3

3

You are correct. See http://docs.adobe.com/docs/en/cq/current/deploying/configuring_osgi.html#Configuration%20Details which states:

The following order of precedence is used:

  1. Repository nodes under /apps/*/config....either with type sling:OsgiConfig or property files (CHECK)
  2. Repository nodes with type sling:OsgiConfig under /libs/*/config.... (ootb defns)
  3. Any .config files from /crx-quickstart/launchpad/config/.... on the local file system.

This means that a generic configuration in /libs can be masked by a project specific configuration in /apps.

Are the config nodes run-mode specific? If a run-mode doesn't match, that could explain why the node under apps is not getting applied:

As the same configuration parameter can be located in several places, the system:

  • searches for all nodes of type sling:OsgiConfig
  • filters according to service name
  • filters according to run mode

Also mentioned in the above doc, in case the changes were made when the system is running, then the following order of precedence applies:

  • Modifying a configuration in the Web console will take immediate effect as it takes precedence at runtime.
  • Modifying a configuration in /apps will take immediate effect.
  • Modifying a configuration in /libs will take immediate effect, unless it is masked by a configuration in /apps.

This might explain why the config changes done in the OSGI console is being picked instead of the changes in your /apps.

Community
  • 1
  • 1
Shawn
  • 8,374
  • 5
  • 37
  • 60
  • thanks for clarification but still not sure what might be the reason for this :(. As asked, `configuration` is not run-mode specific – Rupesh Nov 20 '14 at 04:58
  • 1
    learned one more thing, `felix > apps > libs` is precedence order while looking for configurations at *run time* and `apps > libs > felix` is the order while *startup* – Rupesh Nov 22 '14 at 12:27
0

The following order of precedence is used:

    Repository nodes under /apps/*/config....either with type sling:OsgiConfig or property files (CHECK)
    Repository nodes with type sling:OsgiConfig under /libs/*/config.... (ootb defns)
    Any .config files from /crx-quickstart/launchpad/config/.... on the local file system.

This means that a generic configuration in /libs can be masked by a project specific configuration in /apps.

In CQ5. Any changes done in felix console modifies the config files with the highest priority.

For eg under

/apps/*/config you have an "org.apache.sling.security.impl.ReferrerFilter.config" file

And you modify the Apache Sling Referrer Filter via felix console

The config file "org.apache.sling.security.impl.ReferrerFilter.config" present under /apps/*/config will be modified with the value you just entered in felix console.

Nithish Thomas
  • 1,515
  • 14
  • 20
0

Resolution order at Runtime

Configuration changes made while the system is running trigger a reload with the modified configuration.

Then the following order of precedence applies:

  1. Modifying a configuration in the Web Console will take immediate effect as it takes precedence at runtime.
  2. Modifying a configuration in /apps will make immediate effect.
  3. Modifying a configuration in /libs will take immediate effect, unless it is masked by a configuration in /apps.

Resolution order at startup

  1. Repository nodes under /apps/*/config….. either with type sling:OsgiConfig or property files

  2. Repository nodes with type sling:OsgiConfig under /libs/*/config…. (ootb)

  3. Any .config files from /crx-quickstart/launchpad/config/… on the local file system

Diego Nieto
  • 581
  • 2
  • 10
  • 23