AEM 6.5: Adding custom Factory configuration for CORS does not work anymore

OlivBur

14-05-2019

We tried to update our CORS configuration in AEM 6.5.0.0 according to this help article: Adobe Experience Manager Help | Understanding Cross-Origin Resource Sharing (CORS) with AEM .

But this does not seem to work (anymore). If we follow the guide and add it to your package and deploy it again. It does not recognize it as an instance of the CORS configuration factory component.

We have the same issue with adding a custom Logging to the LogFactory, as documented here: Monitoring and Maintaining Your AEM instance

Do you have the same issue? We haven't tested it yet with the latest AEM 6.4.x.

Thanks for support.

Accepted Solutions (1)

Accepted Solutions (1)

OlivBur

14-05-2019

Ahh so we have found now the solution: We needed to rename the config xml file to "com.adobe.granite.cors.impl.CORSPolicyImpl-IDENTIFIER.xml".

So we needed to add a Dash between the Factory PID and the IDENTIFIER.

Before we added manually via the Felix Config console the additional config and then we simply packaged up the stored config nodes from the CRX. But this procedure seems not to work for Factory configs.

Actually this is also documented here: Configuring OSGi in a special Note box .

Answers (6)

Answers (6)

OlivBur

14-05-2019

Ahh interesting - because as I did the same procedure as you described, I did not receive a config node name with a Dash in between the Factory PID name and Identifier...

which AEM version did you use?

jbrar

Employee

14-05-2019

I tried editing the CORS configuration from /system/console/configMgr. Once i save the changes, noticed the following file getting created under crxde:

/apps/system/config/com.adobe.granite.cors.impl.CORSPolicyImpl-122113ad-1f51-4b73-9c4f-ba1c0d2f1395.config

Have you tried updating the configuration from /system/console/configMgr ?

In another test, I installed the copy-pasted the "com.adobe.granite.cors.impl.CORSPolicyImpl-122113ad-1f51-4b73-9c4f-ba1c0d2f1395.config" and changed the PID and can see the configs under CORS:

So, check the syntax as you should only be changing the PID number (122113ad-1f51-4b73-9c4f-ba1c0d2f1395) for example

OlivBur

14-05-2019

As you can see JaideepBrar​ in my previous comment with the Screenshot, we used actually the same PID ("com.adobe.granite.cors.impl.CORSPolicyImpl.c9d2e058-2403-43ac-8755-a5693ddf4ae8")...that's why we are a bit confused....

OlivBur

14-05-2019

Hi JaideepBrar​,

sorry need to correct my initial description: The configuration worked so far for one added custom configuration, but it is displayed not right below the "Adobe Granite Cross-Origin Resource Sharing Policy" in the Felix Configuration view, which was a bit confusing.

Screenshot:

aem65-cors-config-factory-issue01.jpg

jbrar

Employee

14-05-2019

As mentioned at [1], Setup the following logging to check why its failing:

Logging is available under com.adobe.granite.cors:

  • enable DEBUG to see details about why a CORS request was denied
  • enable TRACE to see details about all requests going through the CORS handler

[1] Adobe Experience Manager Help | Understanding Cross-Origin Resource Sharing (CORS) with AEM