Hi ,
We have a requirement to populate the dropdown values by reading the JSON value using datasource .So I had uploaded JSON data and created a servlet to populate the values in dropdown .But it is not working on local AEM environment whereas it works on lower AEM instance .Please suggest whether this has any dependencies .
Thanks in Advance!
Solved! Go to Solution.
Views
Replies
Total Likes
Hey @Keerthi97
I have faced a similar issue in my project.
The root cause for me was that I have used a reserved keyword of AEM for node names such as "config" for data sources. Renaming the node name had solve the issue for me.
Only admin is supposed to access config, hence, It is working with admin credentials but not using author.
Regards,
Arpit Varshney
Hey @Keerthi97
I have faced a similar issue in my project.
The root cause for me was that I have used a reserved keyword of AEM for node names such as "config" for data sources. Renaming the node name had solve the issue for me.
Only admin is supposed to access config, hence, It is working with admin credentials but not using author.
Regards,
Arpit Varshney
Hi @Keerthi97 ,
In the DataSorce Servlet, com.adobe.cq.commerce.common.ValueMapDecorator is replaced with org.apache.sling.api.wrappers.ValueMapDecorator. This could be the cause of the import. Please check and update.
GitHub Reference - https://github.com/adobe/asset-share-commons/pull/377
If it is still not working, please give more details on the code and node xml.
Hope this will help !
Regards
Hi,
Can you check this https://aemlab.blogspot.com/2019/07/aem-touch-ui-dropdown-from-json.html
Are you using any service usr for reading json?
@Keerthi97 you can check for the below things:
1. If on your local AEM instance, the servlet is getting resolved or not. If it is not getting resolved, you might need to check and update the "org.apache.sling.servlets.resolver.SlingServletResolver" configuration if you are having anything other than the list mentioned in the property "Execution Paths".
2. Is there any system resource resolver being used.
Map<String, Object> param = new HashMap<String, Object>(); param.put(ResourceResolverFactory.SUBSERVICE, "writeService");
ResourceResolver resolver = null;
try { resolver = resolverFactory.getServiceResourceResolver(param) } catch (Execption e){}
And then create the configuration as shown below:
And the provided the respective read permission to read the json
Reference: https://one-inside.com/aem6-resourceresolver-access-in-services/
Thanks
Views
Likes
Replies