Unable to see the CA Config in Configuration Editor | Community
Skip to main content
Level 2
June 13, 2023
Solved

Unable to see the CA Config in Configuration Editor

  • June 13, 2023
  • 2 replies
  • 2316 views

We have added wcm-io package to our instance and to the project as a dependency. We have also created a template inside our project under /apps/myproject/templates/ca-config-page with the following jcr:content node:

{"jcr:primaryType":"cq:PageContent","jcr:createdBy":"admin","jcr:created":"Tue Jan 03 2023 17:18:25 GMT-0800","sling:resourceType":"wcm-io/caconfig/editor/components/page/editor"}

I created a CA config in the codebase using the @2932483 annotation. Following is the configuration:

package com.myproject.core.caconfig;

import org.apache.sling.caconfig.annotation.Configuration;
import org.apache.sling.caconfig.annotation.Property;

@Configuration(label = "Test configuration", description = "TEst configuration")
public @interface Events {
/**
* @return some value
*/
@Property(label = "Some value", description = "Some Value", order = 1)
String someValue();

}

I created a CA-config page under content/myproject.

 

However, it does not show the CA-config that I created when I click on the Add button.  What am I missing here?  

 

Thanks in advance!

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 EstebanBustamante

Are you using the bnd-maven-plugin? If so, there is a known issue where the context aware configurations are created as java interface, the bnd-maven-plugin is not able to scan the class, hence no context aware configurations are detected.

 

Fix

Add multiple plugins as comma-separated values i.e. https://bnd.bndtools.org/instructions/plugin.html
example
-plugin org.apache.sling.caconfig.bndplugin.ConfigurationClassScannerPlugin,org.apache.sling.bnd.models.ModelsScannerPlugin

 

Source: https://github.com/adobe/aem-project-archetype/issues/975

 

2 replies

EstebanBustamante
Community Advisor and Adobe Champion
EstebanBustamanteCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
June 13, 2023

Are you using the bnd-maven-plugin? If so, there is a known issue where the context aware configurations are created as java interface, the bnd-maven-plugin is not able to scan the class, hence no context aware configurations are detected.

 

Fix

Add multiple plugins as comma-separated values i.e. https://bnd.bndtools.org/instructions/plugin.html
example
-plugin org.apache.sling.caconfig.bndplugin.ConfigurationClassScannerPlugin,org.apache.sling.bnd.models.ModelsScannerPlugin

 

Source: https://github.com/adobe/aem-project-archetype/issues/975

 

Esteban Bustamante
Level 2
June 13, 2023

Hi @estebanbustamante,

 

Thanks for you reply!

I dont think thats the issue, I am able to see CA-configs from other projects available in the instance but not the ones that are created inside myproject codebase. To test this, I created a ca-config inside one of the other projects and I was able to see the configuration inside /content/myproject/ca-config. 

Moreover, when I am adding the configuration to /conf/myprojects/sling:configs manually(that is, from crx/de), my codebase is able to read the configuration and execute the functionalities as expected.

June 13, 2023

Hey @estebanbustamante! I know what you mean now! And it worked. I forgot to check this one but mine was not seperated by comma. I made that change and it worked: 

Bundle-DocURL:
-plugin org.apache.sling.caconfig.bndplugin.ConfigurationClassScannerPlugin, org.apache.sling.bnd.models.ModelsScannerPlugin

 

Thanks again for helping!

VeenaVikraman
Community Advisor
Community Advisor
January 22, 2024

For anyone facing the same issue , as @estebanbustamante mentioned , you need to add your CA class values in the pom.xml. You can add it as Sling-ContextAware-Configuration-Classes: in the CDATA section of <bnd> tag like below