Facing Issue Using datasource in AEM 6.3 | Community
Skip to main content
sandeep_R_sahu
December 20, 2017
Solved

Facing Issue Using datasource in AEM 6.3

  • December 20, 2017
  • 2 replies
  • 2917 views

Hey Guys,

Hope you are doing well.

We are migrating from AEM 6.1 to AEM 6.3.

And I noticed that drop down in dialog populating through datasource started giving error in AEM 6.3 as below, which was working fine in AEM 6.1.

20.12.2017 18:38:39.569 *ERROR* [10.2.40.186 [1513775319444] GET /mnt/override/apps/my-project/components/content/my-component/_cq_dialog.html/content/my-site/en/my-page/jcr:content/contentpar/my-component HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException

java.lang.NullPointerException: null

at com.day.cq.wcm.core.impl.TemplateUtils.isPageOfAuthoredTemplate(TemplateUtils.java:158)

at com.day.cq.wcm.core.impl.policies.ContentPolicyStatus.buildContentPolicyStatus(ContentPolicyStatus.java:172)

at com.day.cq.wcm.core.impl.components.TouchEditContextImpl.drawContentEpilog(TouchEditContextImpl.java:697)

at com.day.cq.wcm.core.impl.components.EditContextImpl.includeEpilog(EditContextImpl.java:278)

at com.day.cq.wcm.core.impl.components.ComponentContextImpl.includeEpilog(ComponentContextImpl.java:334)

at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:279)

at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:96)

at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)

at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:282)

at org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProcessorImpl.java:322)

at org.apache.sling.engine.impl.request.SlingRequestDispatcher.dispatch(SlingRequestDispatcher.java:211)

at org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatcher.java:104)

at com.day.cq.wcm.core.impl.WCMComponentFilter$ForwardRequestDispatcher.include(WCMComponentFilter.java:516)

at com.adobe.granite.ui.components.impl.BaseComponentHelper.fetchData(BaseComponentHelper.java:605)

at com.adobe.granite.ui.components.impl.BaseComponentHelper.asDataSource(BaseComponentHelper.java:449)

at com.adobe.granite.ui.components.impl.BaseComponentHelper.getItemDataSource(BaseComponentHelper.java:411)

at com.adobe.granite.ui.components.impl.BaseComponentHelper.getItemDataSource(BaseComponentHelper.java:382)

at com.adobe.granite.ui.components.ComponentHelper.getItemDataSource(ComponentHelper.java:277)

at org.apache.jsp.libs.granite.ui.components.foundation.form.select.render_jsp._jspService(render_jsp.java:191)

at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)

Have you guys faced any similar kind of issue. And how to implement datasource to populate drop down in dialog in AEM 6.3.

Any lead will be very helpful.

Thanks,

Sandeep

Message was edited by: Sandeep Sahu

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 smacdonald2008

It works in AEM 6.3. See:

https://helpx.adobe.com/experience-manager/using/aem63_datasource.html

This Select field is populated by a DataSource object.

2 replies

smacdonald2008
smacdonald2008Accepted solution
December 20, 2017

It works in AEM 6.3. See:

https://helpx.adobe.com/experience-manager/using/aem63_datasource.html

This Select field is populated by a DataSource object.

sandeep_R_sahu
December 21, 2017

Thank you Scott. You guys are awesome .

I am having a component called as datasource which can be authored to populate dynamic number of drop down options wherever used.

Two points which helped me are:     

1. The different way of creating DataSource that is below section in Java code

@SuppressWarnings("unchecked")

//Creating the Datasource Object for populating the drop-down control.

DataSource ds = new SimpleDataSource(new TransformIterator(countries.keySet().iterator(), new Transformer() {

@Override

//Transforms the input object into output object

public Object transform(Object o) {

String country = (String) o;

//Allocating memory to Map

ValueMap vm = new ValueMapDecorator(new HashMap<String, Object>());

//Populate the Map

vm.put("value", country);

vm.put("text", countries.get(country));

return new ValueMapResource(resolver, new ResourceMetadata(), "nt:unstructured", vm);

}

}));

2. At datasource Node in touch dialog, I was putting path of component as the value for the property sling:resourceType, while putting path till .html worked : /apps/db-eccs-wm-pwcc/components/content/datasource/datasource.html.

Thank you.