Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

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

Avatar

Avatar
Ignite 10
Level 4
TB3dock
Level 4

Likes

34 likes

Total Posts

203 posts

Correct Reply

4 solutions
Top badges earned
Ignite 10
Boost 25
Give Back 25
Validate 10
Validate 1
View profile

Avatar
Ignite 10
Level 4
TB3dock
Level 4

Likes

34 likes

Total Posts

203 posts

Correct Reply

4 solutions
Top badges earned
Ignite 10
Boost 25
Give Back 25
Validate 10
Validate 1
View profile
TB3dock
Level 4

07-05-2021

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.

 

TB3dock_0-1620373273134.png

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"
}

 

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 100
Level 7
rush_pawan
Level 7

Likes

120 likes

Total Posts

192 posts

Correct Reply

77 solutions
Top badges earned
Boost 100
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Boost 100
Level 7
rush_pawan
Level 7

Likes

120 likes

Total Posts

192 posts

Correct Reply

77 solutions
Top badges earned
Boost 100
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile
rush_pawan
Level 7

07-05-2021

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

Answers (5)

Answers (5)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,356 likes

Total Posts

3,227 posts

Correct Reply

917 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,356 likes

Total Posts

3,227 posts

Correct Reply

917 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

08-05-2021

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

Avatar

Avatar
Affirm 50
MVP
Vaibhavi
MVP

Likes

216 likes

Total Posts

181 posts

Correct Reply

61 solutions
Top badges earned
Affirm 50
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Affirm 50
MVP
Vaibhavi
MVP

Likes

216 likes

Total Posts

181 posts

Correct Reply

61 solutions
Top badges earned
Affirm 50
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile
Vaibhavi
MVP

07-05-2021

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?

Avatar

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

559 likes

Total Posts

676 posts

Correct Reply

194 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

559 likes

Total Posts

676 posts

Correct Reply

194 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile
asutosh_jena
Level 10

07-05-2021

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

Avatar

Avatar
Springboard
Level 7
Prince_Shivhare
Level 7

Likes

112 likes

Total Posts

394 posts

Correct Reply

64 solutions
Top badges earned
Springboard
Establish
Give Back 100
Boost 100
Validate 1
View profile

Avatar
Springboard
Level 7
Prince_Shivhare
Level 7

Likes

112 likes

Total Posts

394 posts

Correct Reply

64 solutions
Top badges earned
Springboard
Establish
Give Back 100
Boost 100
Validate 1
View profile
Prince_Shivhare
Level 7

07-05-2021

Hi @TB3dock ,

 

It should be available in config Manager.

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

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.

2.PNG
Thanks,

Prince

Avatar

Avatar
Boost 1
Level 1
sprince1504
Level 1

Like

1 like

Total Posts

1 post

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
sprince1504
Level 1

Like

1 like

Total Posts

1 post

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
sprince1504
Level 1

07-05-2021

.