Common Config folder not activating osgi component | Community
Skip to main content
Adilmo
Level 4
September 3, 2020
Solved

Common Config folder not activating osgi component

  • September 3, 2020
  • 1 reply
  • 1343 views

Hi All, 

 

We have following structure 

 

/apps/*/config  -  (sling:folder)

/apps/*/config.author   -  (nt:folder)  

/apps/*/config.author.dev   -  (nt:folder)  

 

We are running aem with author runmodes [dev, author]. 

 

Now when we deploy these folders only configs from config.author.dev activate the osgi component. Even if we manually change configs in /apps/*/config folder it does not activate my component with new config. 

 

However, if we change configs under config.author.dev it does reactivate my component with the configs under the config.author.dev folder. 

 

Documentation says config is applicable to all run modes. So just wondering if this behavior is correct. 

 

Further, do we need have all the folders as sling:folder rather than nt:folder. What is the purpose of declaring a folder as sling:folder ? 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Andrei_Dantsou

Hello @adilmo,

The behavior you've described is expected, since if there are several config folders with multiple run modes combined, the most specific one is applied. In your case config.author.dev has a priority over just config or config.author. More details about config resolution order can be found here (please see the "Resolution of multiple Run Modes" section).

The documentation suggests using sling:folder for managing OSGI configs. Differences between sling:folder and nt:folder (please see the link for reference):

nt:folder - This node type represents a plain file system folder (it can have nt:folder and nt:file children and only a few restricted meta data properties) // so quite restricted in terms of properties and nodes.

sling:folder - This node type is basically nt:folder + nt:unstructured in one, i.e. it can be used inside other nt:folders. // should be used more often.


Regards

1 reply

Andrei_Dantsou
Andrei_DantsouAccepted solution
Level 3
September 3, 2020

Hello @adilmo,

The behavior you've described is expected, since if there are several config folders with multiple run modes combined, the most specific one is applied. In your case config.author.dev has a priority over just config or config.author. More details about config resolution order can be found here (please see the "Resolution of multiple Run Modes" section).

The documentation suggests using sling:folder for managing OSGI configs. Differences between sling:folder and nt:folder (please see the link for reference):

nt:folder - This node type represents a plain file system folder (it can have nt:folder and nt:file children and only a few restricted meta data properties) // so quite restricted in terms of properties and nodes.

sling:folder - This node type is basically nt:folder + nt:unstructured in one, i.e. it can be used inside other nt:folders. // should be used more often.


Regards

Adilmo
AdilmoAuthor
Level 4
September 3, 2020
ok but the behaviour is quite strange ... adobe docs suggest that config folder is applicable to all run modes. So one would expect that if a configuration which is not present in config.author.dev and is present in config folder shall be picked up.