osgi config file not working (not appearing in config manager). Incorrect name? | Community
Skip to main content
Level 8
May 7, 2021 7:42 AM UTC
Solved

osgi config file not working (not appearing in config manager). Incorrect name?

In order to create a cors entry, we created a file:

 

 

/myapp.ui.config/src/main/content/jcr_root/apps/myapp/osgiconfig/config.author.dev/com.adobe.granite.cors.impl.CORSPolicyImpl-myapp.cfg.json

 

 

When we deploy the project to the local author instance using mvn clean install -PautoInstallSinglePackage in the root, then look in the config manager, it is not there.  Should it be?

Here I am assuming that when you run the AEM SDK locally, its in dev run mode.

 

above is only a config which was manually created.  We would expect our mypp config to also be there.

 

The contents were this:

 

 

{ "alloworigin":["*"], "alloworiginregexp":[], "allowedpaths":[".*"], "exposedheaders":[""], "maxage":1800, "supportedheaders":["*"], "supportedmethods":["GET","POST"], "supportedcredentials":"true" }

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Pawan-Gupta
Pawan-GuptaAccepted solution
Level 8
May 7, 2021 8:40 PM UTC

Hello,

Just to add, the local config file name should not have "-" in the file name rather use "~" to make it work. so create the file name as

 

/myapp.ui.config/src/main/content/jcr_root/apps/myapp/osgiconfig/config.author.dev/com.adobe.granite.cors.impl.CORSPolicyImpl~myapp.cfg.json

10 replies

arunpatidar
New Participant
May 8, 2021 7:39 PM UTC

Hi

local AEM SDK does not contain dev run mode by default. you can set though using command line when you start aem or set in sling:properties file.

you can varify run modes on instance at http://localhost:4502/libs/granite/operations/content/systemoverview.html

Translate
Arun Patidar
TB3dockAuthor
Level 8
May 9, 2021 8:19 AM UTC
Thanks, I had assumed that local dev instance would be in dev mode, this solved the main problem. Sadly, that system overview link doesnt work on the target cloud instances, only local SDK.
Translate
Pawan-Gupta
Pawan-GuptaAccepted solution
Level 8
May 7, 2021 8:40 PM UTC

Hello,

Just to add, the local config file name should not have "-" in the file name rather use "~" to make it work. so create the file name as

 

/myapp.ui.config/src/main/content/jcr_root/apps/myapp/osgiconfig/config.author.dev/com.adobe.granite.cors.impl.CORSPolicyImpl~myapp.cfg.json
Translate
Asutosh_Jena_
New Participant
May 7, 2021 9:32 AM UTC

Hi @tb3dock 

 

Your configuration is created under config.author.dev which will be used only for the developement author environment.

/myapp.ui.config/src/main/content/jcr_root/apps/myapp/osgiconfig/config.author.dev/com.adobe.granite.cors.impl.CORSPolicyImpl-myapp.cfg.json

 

if your current instance is running on dev, author runmode, you will be able to see the above config under system/console/configMgr, else it will not be picked by the instance even though it is present under /apps/myapp/osgiconfig/config.author.dev

 

if you want it to be available on your local author instance, put it either to /apps/myapp/osgiconfig/config or create a new run mode such as /apps/myapp/osgiconfig/config.author.local and set the run mode in the sling.properties file as a property like "sling.run.modes=local, author"

 

Hope this helps!

 

Thanks

Translate
TB3dockAuthor
Level 8
May 7, 2021 11:15 AM UTC

We assume because we are running the author instance locally, it must be in dev mode, as its not stage or prod, and there are only 3 possibilities.  We don't have a sling.propertiers file currently.

Translate
Prince_Shivhare
New Participant
May 7, 2021 9:14 AM UTC

Hi @tb3dock ,

 

It should be available in config Manager.

you should keep the file in the part mentioned by @vaibhavi_j .

and make sure you are building all the modules in maven not only the ui.apps.

it should deploy it to config Manager. Also, check-in CRXDE if you are able to see this in osgiconfig node.


Thanks,

Prince

Translate
Level 2
May 7, 2021 9:10 AM UTC

.

Translate
Vaibhavi_J
Level 7
May 7, 2021 8:14 AM UTC

Hi @tb3dock ,

 

Please have a check in crx if the newly created config is available in the below path.

/apps/myapp/osgiconfig/config.author.dev/com.adobe.granite.cors.impl.CORSPolicyImpl-myapp.cfg.json

 

Also please confirm if your local instance run mode is set to dev?

Translate
TB3dockAuthor
Level 8
May 7, 2021 11:13 AM UTC
Yes, its in the CRX viewer, but not in the osgi config viewer. I am running locally, so must be dev. How do you verify?
Translate