Getting error for some user After adding my user component | Community
Skip to main content
Level 2
May 11, 2022

Getting error for some user After adding my user component

  • May 11, 2022
  • 2 replies
  • 1952 views

Hello Everyone,

 

I am getting error after adding one of my component that is user component. This error is coming only for some user.

 

Error:  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: Identifier com.adobe.aem.commons.assetshare.components.structure.UserMenu cannot be correctly instantiated by the Use API

 

 

 

Please suggest me what I need to for fix this issue

 

Please also see the log for this issue.

 

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: Identifier com.adobe.aem.commons.assetshare.components.structure.UserMenu cannot be correctly instantiated by the Use API

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:570) [org.apache.sling.engine:2.7.4]

at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:45) [org.apache.sling.engine:2.7.4]

at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:82) [org.apache.sling.engine:2.7.4]

at com.day.cq.wcm.core.impl.WCMDeveloperModeFilter.doFilter(WCMDeveloperModeFilter.java:119) [com.day.cq.wcm.cq-wcm-core:5.12.164]

at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.7.4]

at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:138) [com.day.cq.wcm.cq-wcm-core:5.12.164]

at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.7.4]

at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.7.4]

at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:278) [com.day.cq.wcm.cq-wcm-core:5.12.164]

at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.7.4]

at com.day.cq.wcm.core.impl.page.PageLockFilter.doFilter(PageLockFilter.java:91) [com.day.cq.wcm.cq-wcm-core:5.12.164]

at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.7.4]

at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:94) [com.day.cq.cq-personalization:5.12.44]

at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.7.4]

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:72) [org.apache.sling.engine:2.7.4]

at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:283) [org.apache.sling.engine:2.7.4]

at org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProcessorImpl.java:323) [org.apache.sling.engine:2.7.4]

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

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

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

at com.adobe.cq.sightly.WCMScriptHelper.includeResource(WCMScriptHelper.java:179) [com.adobe.cq.sightly.cq-wcm-sightly-extension:1.6.0]

... 219 common frames omitted

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Magicr
Level 6
May 11, 2022

The most likley reason is this is that an included model class returns a Null value. So go to html file from your component and look for:

 

<sly data-sly-use.<your sly-identifiere>="<full qualified java class>"/>

Then start the debugger in your IDE and find out why the including class returns Null.

user00181Author
Level 2
May 12, 2022

@magicr I have already check in User menu java class, i have already implement the null check. Actually this issue is coming only for some user not for all user. Mainly this issue is coming on prod so i am not able to debug the java code.

Magicr
Level 6
May 12, 2022

When the error message for only a couple of users occurs, then you have to check the existing user objects with some users which are working. May be there same properties are missing or the user object is corrupt in repository. You can export the user by creating a package. Use a program that can compare textfiles (I.e. Beoynd compare).

DEBAL_DAS
New Member
May 11, 2022

could you please check whether UserMenu Sling model is available in your instance using below and to what resources they are bound

http://aemhost:port/system/console/status-slingmodels

http://aemhost:port/system/console/adapters

http://aemhost:port/system/console/status-adapters

Debal Das, Senior AEM Consultant
user00181Author
Level 2
May 12, 2022

@debal_das I have check in all 3 place UserMenu Sling model is available.

DEBAL_DAS
New Member
May 14, 2022

As this error is coming only for some user, what are you trying to read(information) for each user when they are trying to add this component?

Debal Das, Senior AEM Consultant