How can resolved "org.apache.sling.scripting.sightly.render.ObjectModel Cannot access method configured on object com.adobe.cq.wcm.core.components.internal.models.v1.ExperienceFragmentImpl" | Community
Skip to main content
Adobe Employee
March 17, 2021
Solved

How can resolved "org.apache.sling.scripting.sightly.render.ObjectModel Cannot access method configured on object com.adobe.cq.wcm.core.components.internal.models.v1.ExperienceFragmentImpl"

  • March 17, 2021
  • 3 replies
  • 8258 views

AEM:  as cloud Service

 

I'm getting below error in the error.log when using content fragment in my content pages. 

 

org.apache.sling.scripting.sightly.render.ObjectModel Cannot access method configured on object com.adobe.cq.wcm.core.components.internal.models.v1.ExperienceFragmentImpl@10ff42d2
java.lang.reflect.InvocationTargetException: null

...

 

Kindly please let me know what causing this error and how to resolve it. 

 

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 arunpatidar

Try to refresh the bundle, it will resolve the issue.

3 replies

Kiran_Vedantam
Community Advisor
Community Advisor
March 17, 2021

Hi @woobi,

 

As per the error, please check if the core project is installed and resolved in your instance. The issue is regarding the "com.adobe.cq.wcm.core.components.internal.models.v1.ExperienceFragmentImplmodel here.

 

Hope this helps.

 

Thanks,

Kiran Vedantam

Adobe Employee
March 17, 2021

UPDATE: i misread this error (thought you were referencing the impl class, but really it looks like the HTL cannot instantiate the Sling Model via the interface reference (which is bound to that Impl). See Arun's answer below.

 

You are trying to access an INTERNAL class as denoted by the "internal" package name: com.adobe.cq.wcm.core.components.internal.models.v1.ExperienceFragmentImpl

Classes under internal packages are considered internal implementation details of the project and cannot be used by Consumer code. 

 

In AEM development, typically you will have public interfaces you can code against, but the implementation (usually post-fixed with Impl) will not be exported by the bundle therefore not available for you to directly use.

 

Instead of using the Impl directly in Core Components, you should leverage the Sling Model Delegation pattern described on the Core Components Github project: https://github.com/adobe/aem-core-wcm-components/wiki/Delegation-Pattern-for-Sling-Models

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
March 18, 2021

Try to refresh the bundle, it will resolve the issue.

Arun Patidar