Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

AEM exception : Uncaught SlingException org.apache.sling.scripting.jsp.jasper.JasperException: Unable to compile

Avatar

Level 1

Hi Friends,

 

Need your hep in resolving below exceptions: getting below exception post migration from AEM 5.6.1 to AEM 6.1.

All bundles are in active state.

19.01.2016 02:53:11.724 *ERROR*  com.day.cq.wcm.tags.IncludeTag Error while executing script content.jsp
org.apache.sling.api.scripting.ScriptEvaluationException: org.apache.sling.scripting.jsp.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 83 in the jsp file: /apps/social/commons/commons.jsp
The method getUserProperties(ResourceResolver, String) is undefined for the type CollabUtil
80:         final CollabUser author = resource.adaptTo(Comment.class).getAuthor();
81:         final ValueMap map = resource.adaptTo(ValueMap.class);
82:         resourceAuthorID = map.get("userIdentifier", String.class);
83:         final UserProperties userProperties = CollabUtil.getUserProperties(resourceResolver,
84:             resourceAuthorID);
85:         if(userProperties != null){
86:             resourceAuthorName = userProperties.getDisplayName();

     at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:388)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:463)
    at com.day.cq.wcm.tags.IncludeTag.includeScript(IncludeTag.java:167)
    at com.day.cq.wcm.tags.IncludeTag.doEndTag(IncludeTag.java:87)
    at org.apache.jsp.apps.usg_005fcom.components.templates.t05_005fproductdetail.body_jsp._jspx_meth_cq_005finclude_005f1(body_jsp.java:331)
    at org.apache.jsp.apps.usg_005fcom.components.templates.t05_005fproductdetail.body_jsp._jspService(body_jsp.java:280)
    at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:284)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:102)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:536)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:463)
    at com.day.cq.wcm.tags.IncludeTag.includeScript(IncludeTag.java:167)
    at com.day.cq.wcm.tags.IncludeTag.doEndTag(IncludeTag.java:87)
    at org.apache.jsp.apps.usg_005fcom.components.templates.basepage.basepage_jsp._jspx_meth_cq_005finclude_005f1(basepage_jsp.java:286)
    at org.apache.jsp.apps.usg_005fcom.components.templates.basepage.basepage_jsp._jspService(basepage_jsp.java:240)
    at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:284)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:102)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:536)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:463)
    at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:533)
    at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:77)
    at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:96)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:182)
    at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:149)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:259)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.day.cq.wcm.core.impl.WCMDeveloperModeFilter.doFilter(WCMDeveloperModeFilter.java:117)
    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:216)
    at org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatcher.java:103)
    at com.day.cq.wcm.core.impl.WCMComponentFilter$ForwardRequestDispatcher.include(WCMComponentFilter.java:445)
    at org.apache.jsp.libs.foundation.components.primary.cq.Page.Page_jsp._jspService(Page_jsp.java:106)
    at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)

2 Replies

Avatar

Level 1

Hi

The "CollabUtils" class does not exists in AEM 6.1 anymore. Instead of "CollabUtils" use "SocialUtils" or "SocialResourceUtils". May be you have also to use the class "User" instead of "CollabUser". Just compare the javadoc of  AEM 5.6 and AEM 6.0 with AEM 6.1. Your IDE should display an error or mark the class as deprecated in line 83. I prefer to debug and check the objects, if they got the correct attributes and values, just to be sure, because a migration is always difficult and there are may be some more errors, which you would like to avoid.

Reference:

AEM 6.0 Javadoc: https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/adobe/cq/social/commons/CollabUtil.ht...

AEM 6.1 Javadoc User-Class: https://docs.adobe.com/docs/en/aem/6-1/ref/javadoc/com/adobe/cq/social/scf/User.html

Avatar

Level 1

Hi ,CeLeBratioN,

The information provided you i had followed but unfortunately the use of "SocialUtils" or "SocialResourceUtils also depricated in AEM 6.1 version.

Reference Link:

https://docs.adobe.com/docs/en/aem/6-1/ref/javadoc/deprecated-list.html#class

Any suggestion here?

 

 

Thanks 

Chandra