Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Unable to recognize installed bundle class in the class which extends WCMUse

Avatar

Level 7

Hi,

I have created a component using sightly. I've created component java class which extends WCMUse under the component. In this class, I'm using some other util class which is already deployed in AEM instance using maven commands. But whenever I'm rendering my component I'm getting the below error message -

Error Message:

org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: No use provider could resolve identifier: com.mycompany.util.Constants.

........................

Caused by: io.sightly.java.api.SightlyUseException: No use provider could resolve identifier: Constants
    at io.sightly.java.engine.extension.use.UseExtension$1.call(UseExtension.java:87)
    at io.sightly.java.runtime.common.SightlyRuntimeImpl.call(SightlyRuntimeImpl.java:51)
    at apps.tc.components.modules.slideshow.SightlyJava_slideshow.render(SightlyJava_slideshow.java:32)
    at io.sightly.java.api.BaseRenderUnit.render(BaseRenderUnit.java:39)
    at io.sightly.java.engine.SightlyScriptEngine.evaluateScript(SightlyScriptEngine.java:106)
    at io.sightly.java.engine.SightlyScriptEngine.eval(SightlyScriptEngine.java:91)
    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)
    ... 117 common frames omitted

 

Remaining components which are using this class, they are working properly. But the remaining components are rendered using JSTL. Please help me in this.

Thanks,

Arya.

1 Accepted Solution

Avatar

Correct answer by
Employee

So far I have most of my Sightly development all via OSGi-bundles.

Can you try to move your classes to a bundle, and see if this solves the issue.

Then we know what might be the issue.

View solution in original post

4 Replies

Avatar

Level 2

It looks like you did something like:

<tag data-sly-use.var="Constants" ...> ... </tag>

The Use-API accepts only the following objects: classes implementing the io.sightly.java.api interface or extending the com.adobe.cq.sightly.WCMUse class, classes adaptable from Resource / SlingHttpServletRequest and JavaScript Use-API scripts.

Avatar

Employee

Can you give my your sightly-code? Your data-sly-use usage?

And if possible the code of your class..

Then I can have a look.

Avatar

Correct answer by
Employee

So far I have most of my Sightly development all via OSGi-bundles.

Can you try to move your classes to a bundle, and see if this solves the issue.

Then we know what might be the issue.

Avatar

Level 7

Feike Visser wrote...

Can you give my your sightly-code? Your data-sly-use usage?

And if possible the code of your class..

Then I can have a look.

 


Hi,

can u pls check ur messages and reply to that message?.

Thanks,

AryA