Hi Everyone,
When I am trying to add one custom component to a page, I get a SlingException error:
Error :
org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.scripting.sightly.SightlyException: Identifier com.mentor.core.core.models.DemoAnnotations cannot be correctly instantiated by the Use API
Have tried different things to fix it, but unable to figure out.
Can anyone provide solution on this error?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @NayanGarade
Have u used the correct adaptables? Resource.class or SlingHttpServletRequest.class or Both?
Whether all the injectors are compulsory? Or else, use defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL
Add logger in your init method (custom method name might be different) having @PostConstruct annotation
Is log displayed in logger file?
Hi @NayanGarade
Have u used the correct adaptables? Resource.class or SlingHttpServletRequest.class or Both?
Whether all the injectors are compulsory? Or else, use defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL
Add logger in your init method (custom method name might be different) having @PostConstruct annotation
Is log displayed in logger file?
Can you please paste your modal class also? One of your identifier is wrong. Mostly wrong annotation scope. Like you have @Resource adaptable, but trying to access higher level context objects. Might need to elevate to @SlingServletReqeust. Difficult to guess without seeing your class. Please share.
@NayanGarade : Please share both the component dialog field names and DemoAnnotations code snippet. By looking at that only anyone will be able to tell what could be wrong there.
Also, there could be some more information in the logs about what may be the issue here.
Views
Replies
Total Likes
Views
Likes
Replies