Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Understanding AEM logs

Avatar

Level 3

Hi,
Intermittently we are facing "Apache Sling Exception" on PRODUCTION for a specific page. 
We are trying to understand the root cause through the logs. However, we're finding difficulty in intercepting them.

LOGS:

Caused by: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.request.TooManyCallsException: /apps/XXXX/components/content/tablev1/normal-cell-header/normal-cell-header.html
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:510) [org.apache.sling.scripting.core:2.3.2]
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:579) [org.apache.sling.engine:2.7.10.B0004]
at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:45) [org.apache.sling.engine:2.7.10.B0004]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:88) [org.apache.sling.engine:2.7.10.B0004]
at com.day.cq.wcm.core.impl.WCMDeveloperModeFilter.doFilter(WCMDeveloperModeFilter.java:119) [com.day.cq.wcm.cq-wcm-core:5.12.226]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.7.10.B0004]
at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:138) [com.day.cq.wcm.cq-wcm-core:5.12.226]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.7.10.B0004]
at org.apache.sling.dynamicinclude.IncludeTagFilter.doFilter(IncludeTagFilter.java:71) [org.apache.sling.dynamic-include:3.1.6]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.7.10.B0004]
at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:278) [com.day.cq.wcm.cq-wcm-core:5.12.226]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.7.10.B0004]
at com.day.cq.wcm.core.impl.page.PageLockFilter.doFilter(PageLockFilter.java:91) [com.day.cq.wcm.cq-wcm-core:5.12.226]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.7.10.B0004]
at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:94) [com.day.cq.cq-personalization:5.12.48]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.7.10.B0004]
at com.adobe.granite.csrf.impl.CSRFFilter.doFilter(CSRFFilter.java:217) [com.adobe.granite.csrf:1.0.20.CQ650-B0002]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.7.10.B0004]
at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:283) [org.apache.sling.engine:2.7.10.B0004]
at org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProcessorImpl.java:323) [org.apache.sling.engine:2.7.10.B0004]
at org.apache.sling.engine.impl.request.SlingRequestDispatcher.dispatch(SlingRequestDispatcher.java:211) [org.apache.sling.engine:2.7.10.B0004]
at org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatcher.java:104) [org.apache.sling.engine:2.7.10.B0004]
at com.day.cq.wcm.core.impl.WCMComponentFilter$ForwardRequestDispatcher.include(WCMComponentFilter.java:516) [com.day.cq.wcm.cq-wcm-core:5.12.226]
at org.apache.sling.scripting.jsp.taglib.IncludeTagHandler.dispatch(IncludeTagHandler.java:54) [org.apache.sling.scripting.jsp.taglib:2.4.0]
at org.apache.sling.scripting.jsp.taglib.AbstractDispatcherTagHandler.doEndTag(AbstractDispatcherTagHandler.java:128) [org.apache.sling.scripting.jsp.taglib:2.4.0]
at org.apache.jsp.libs.foundation.components.parsys.parsys_jsp._jspService(parsys_jsp.java:325)
at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [org.apache.sling.scripting.jsp:2.3.6]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) [org.apache.felix.http.servlet-api:1.2.0]
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502) [org.apache.sling.scripting.jsp:2.3.6]
... 228 common frames omitted

 

Caused by: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.scripting.ScriptEvaluationException:
at com.adobe.cq.sightly.WCMScriptHelper.includeScript(WCMScriptHelper.java:227) [com.adobe.cq.sightly.cq-wcm-sightly-extension:1.6.0]
at com.adobe.cq.sightly.internal.extensions.IncludeExtension.call(IncludeExtension.java:72) [com.adobe.cq.sightly.cq-wcm-sightly-extension:1.6.0]
at org.apache.sling.scripting.sightly.impl.engine.runtime.RenderContextImpl.call(RenderContextImpl.java:77) [org.apache.sling.scripting.sightly:1.1.2.1_4_0]
at org.apache.sling.scripting.sightly.apps.XXXX.components.structure.basepage.body_html.render(body_html.java:90)
at org.apache.sling.scripting.sightly.render.RenderUnit.render(RenderUnit.java:50) [org.apache.sling.scripting.sightly.runtime:1.1.0.1_4_0]
at org.apache.sling.scripting.sightly.impl.engine.SightlyCompiledScript.eval(SightlyCompiledScript.java:60) [org.apache.sling.scripting.sightly:1.1.2.1_4_0]
at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:386) [org.apache.sling.scripting.core:2.3.2]
at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184) [org.apache.sling.scripting.core:2.3.2]
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491) [org.apache.sling.scripting.core:2.3.2]
... 181 common frames omitted

 

Caused by: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.scripting.ScriptEvaluationException:
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:510) [org.apache.sling.scripting.core:2.3.2]
at com.adobe.cq.sightly.WCMScriptHelper.includeScript(WCMScriptHelper.java:222) [com.adobe.cq.sightly.cq-wcm-sightly-extension:1.6.0]
... 189 common frames omitted


Caused by: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.scripting.ScriptEvaluationException:
at com.adobe.cq.sightly.WCMScriptHelper.includeResource(WCMScriptHelper.java:184) [com.adobe.cq.sightly.cq-wcm-sightly-extension:1.6.0]
at com.adobe.cq.sightly.internal.extensions.ResourceExtension.call(ResourceExtension.java:138) [com.adobe.cq.sightly.cq-wcm-sightly-extension:1.6.0]
at org.apache.sling.scripting.sightly.impl.engine.runtime.RenderContextImpl.call(RenderContextImpl.java:77) [org.apache.sling.scripting.sightly:1.1.2.1_4_0]
at org.apache.sling.scripting.sightly.apps.XXXX.components.structure.genericpage.content_html.render(content_html.java:219)
at org.apache.sling.scripting.sightly.render.RenderUnit.render(RenderUnit.java:50) [org.apache.sling.scripting.sightly.runtime:1.1.0.1_4_0]
at org.apache.sling.scripting.sightly.impl.engine.SightlyCompiledScript.eval(SightlyCompiledScript.java:60) [org.apache.sling.scripting.sightly:1.1.2.1_4_0]
at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:386) [org.apache.sling.scripting.core:2.3.2]
at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184) [org.apache.sling.scripting.core:2.3.2]
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491) [org.apache.sling.scripting.core:2.3.2]
... 190 common frames omitted

How do we troubleshoot the error from the above logs? We do not see any reference to java classes. Also we wouldl like to how to understand where to check from this information - org.apache.sling.scripting.sightly.apps.site.components.structure.genericpage.content_html.render(content_html.java:219)

 

What does content_html.render(content_html.java:219) mean? Where and which file should we debug to understand this statement?

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

This entry:

org.apache.sling.api.request.TooManyCallsException

of the stack trace indicates that there are too many internal calls during resource resolutions. There are two common root causes for this:

  1. Many components (including nested sub-components) on a page. @EstebanBustamante and @Sudheer_Sundalam already provided starting points on how to solve this.
  2. A recursive resource inclusion/resolution caused by incorrect inclusion/reference of components.

If #1 does not seem to fix the issue, you might want to double check on resource inclusion. Oftentimes, this can be done pretty fast by deactivating one component after another and check if the issue still occurs. That way you should be able to identify the component causing the issue.

 

Hope that helps!

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @Aj_9625932 ,

 

The content_html.java:219 refers to the generated Java code from your Sightly script (content_html.html). Sightly scripts are compiled into Java code for execution. The error likely occurred at or near line 219 in the original Sightly script.The Sightly script causing the issue is likely named content_html.html and resides in the apps/XXXX/components/structure/genericpage/ directory. Navigate to the AEM CRX at http://localhost:4502/crx/de/index.jsp to find and inspect the Sightly script.

 

Open the content_html.html script and go to line 219 to identify the code that is causing the issue. Look for any complex expressions, includes, or resource references. The error might be due to a missing or misconfigured resource that the script is trying to include (WCMScriptHelper.includeResource). Check if there are Sightly expressions or logic that could lead to a ScriptEvaluationException.

Avatar

Community Advisor

The issue seems to be related to the number of components the page has, please go through these links which explains a possible solution: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-6-5-toomanycallsexcept...

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-6-2-toomanycallsexcept... 

 

Hope this helps.



Esteban Bustamante

Avatar

Community Advisor

Try updating /system/console/configMgr --> Apache Sling Main Servlet "sling.max.calls"property value to 3000 or more.

Avatar

Correct answer by
Employee Advisor

This entry:

org.apache.sling.api.request.TooManyCallsException

of the stack trace indicates that there are too many internal calls during resource resolutions. There are two common root causes for this:

  1. Many components (including nested sub-components) on a page. @EstebanBustamante and @Sudheer_Sundalam already provided starting points on how to solve this.
  2. A recursive resource inclusion/resolution caused by incorrect inclusion/reference of components.

If #1 does not seem to fix the issue, you might want to double check on resource inclusion. Oftentimes, this can be done pretty fast by deactivating one component after another and check if the issue still occurs. That way you should be able to identify the component causing the issue.

 

Hope that helps!