I was trying to take dialog values from AEM component and then map it to POJO class to retrieve data from POJO class but getting error:
org.apache.sling.api.slingexception: Cannot get DefaultSlingScript: No use provider could resolve identifier .......
Please help.
Solved! Go to Solution.
Views
Replies
Total Likes
Package and Class names that referred in HTL are case sensitive.
If your Use class fully qualified name is com.yourpackage.DemoUse then your HTL file should be like
<sly data-sly-use.demoUse="com.yourpackage.DemoUse">
....
</sly>
You are referring as data-sly-use.demoUse="com.yourpackage.demoUse"
Can you provide your POJO class?
If you are using Sling Model, use the correct annotations and give the DEFAULT strategy options.
If any one of the node/property is null / empty, you will see this error.
Views
Replies
Total Likes
Views
Replies
Total Likes
The issue could be with HTL data-sly-use statement. data-sly-use can only have Model/WCMUsePojo type
e.g. https://github.com/arunpatidar02/aem63app-repo/blob/master/java/ClientLibsModel.java
https://github.com/arunpatidar02/aem63app-repo/blob/master/java/DisableEditModel.java
If you will just call POJO from htl, then it will not work.
Views
Replies
Total Likes
Views
Replies
Total Likes
What is the sling model package defined in POM?
e.g. https://github.com/arunpatidar02/aem63app-repo/blob/master/java/POMs/core-pom.xml
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<!-- Import any version of javax.inject, to allow running on multiple
versions of AEM -->
<Import-Package>javax.inject;version=0.0.0,*</Import-Package>
<Sling-Model-Packages>
com.aem64.core
</Sling-Model-Packages>
</instructions>
</configuration>
</plugin>
Are you creating sling model inside this package?
Views
Replies
Total Likes
Views
Replies
Total Likes
Package and Class names that referred in HTL are case sensitive.
If your Use class fully qualified name is com.yourpackage.DemoUse then your HTL file should be like
<sly data-sly-use.demoUse="com.yourpackage.DemoUse">
....
</sly>
You are referring as data-sly-use.demoUse="com.yourpackage.demoUse"
Views
Likes
Replies