Unable to recognize installed bundle class in the class which extends WCMUse | Community
Skip to main content
Dinu_Arya
Level 6
October 16, 2015
Solved

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

  • October 16, 2015
  • 4 replies
  • 1099 views

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.

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 Feike_Visser1

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.

4 replies

radu_cotescu
Adobe Employee
Adobe Employee
October 16, 2015

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.

Feike_Visser1
Adobe Employee
Adobe Employee
October 16, 2015

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.

Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

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.

Dinu_Arya
Dinu_AryaAuthor
Level 6
October 16, 2015

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