Saturday, March 28, 2015

NullPointerException: currentDesign.getDoctype(currentStyle).toRequest(request) - AEM/Adobe CQ5

NullPointerException:  currentDesign.getDoctype(currentStyle).toRequest(request) - AEM/Adobe CQ5

We were getting the NullpoiterException while accessing the pages in Adobe Experience Manager(AEM)

Caused by: java.lang.NullPointerException
at javax.servlet.http.HttpServlet.service(
... 117 more

NullpointerException is thrown while getting the Doctype of the page design.

if (currentDesign != null) {

This issue was getting resolved after restarting the server.

After analysis the currentDesign  and currentStyle objects are not null and getDoctype method is throwing NullpoiterException.

The currentStyle  refers to the path (currentStyle.getPath())- /etc/designs/default.

By default /etc/designs/default/jcr:content path will not have cq:doctype property specified.

To resolve the issue we have added the  cq:doctype - html_5 property to /etc/designs/default/jcr:content


If the property is already available then delete the same and add again.

No comments:

Post a Comment