sighly is not rendering the model so i'm getting this error | Community
Skip to main content
Level 4
May 8, 2023

sighly is not rendering the model so i'm getting this error

  • May 8, 2023
  • 3 replies
  • 1604 views

org.apache.sling.scripting.sightly.render.ObjectModel Cannot access method

 

does anyone know why i'm getting this error?

i'm working on migration for on premise AEM TO AEMaaCS.

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

3 replies

somen-sarkar
Community Advisor
Community Advisor
May 8, 2023

Hi,

Which method is it unable to acces ? Any OOTB or custom code which is throwing the error ? Providing more details about the error stacktrace can be helpful  for community to comment on the same.

 Suggest to check the bundles in OSGI console if they are in active state or not ? Also compare the bundle status wrt to on prem AEM . That may give you some more clue.

 

Thanks,

Somen

Level 4
May 8, 2023

its custom code and the error look like this

which is custom code and the error looks like this
08.05.2023 10:32:30.641 *ERROR* [[0:0:0:0:0:0:0:1] [1683522150107] GET /content/siteroot.html HTTP/1.1] org.apache.sling.scripting.sightly.render.ObjectModel Cannot access method country on object com.ob.code.aem.core.models.pages.v1.webRootModel@84efaaa
java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.sling.scripting.sightly.render.ObjectModel.invokeBeanMethod(ObjectModel.java:448) [org.apache.sling.scripting.sightly.runtime:1.2.6.140]
at org.apache.sling.scripting.sightly.render.ObjectModel.resolveProperty(ObjectModel.java:131) [org.apache.sling.scripting.sightly.runtime:1.2.6.140]
at org.apache.sling.scripting.sightly.render.AbstractRuntimeObjectModel.getProperty(AbstractRuntimeObjectModel.java:153) [org.apache.sling.scripting.sightly.runtime:1.2.6.140]
at org.apache.sling.scripting.sightly.impl.engine.runtime.SlingRuntimeObjectModel.getProperty(SlingRuntimeObjectModel.java:103) [org.apache.sling.scripting.sightly:1.4.20.140]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) [org.apache.felix.http.jetty:4.2.2]
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NullPointerException: null
at com.ob.code.aem.core.models.pages.v1.webRootModel.getCountry(webRootModel.java:30)

somen-sarkar
Community Advisor
Community Advisor
May 8, 2023

In webRootModel class throwing the null pointer exception. Try debugging why getCountry method is returning null ?

krati_garg
Adobe Employee
Adobe Employee
May 8, 2023

@karthickve You must check the error logs, if any bundle is not activated that is responsible to resolve sightly (HTL) APIs, like org.apache.sling.scripting.sightly

 

We might need to restart this bundle

Level 4
May 8, 2023

the only error i'm getting is the above one and the bundle is active

manjunathdj
New Member
May 8, 2023

@karthickve  - Make sure all the bundle are in active status and if not active try to refresh the bundle, it will resolve the issue and also monitor error logs.

 

Thanks,

Level 4
May 8, 2023

yes, its