HtmlLibraryManager cannot be resolved to a type
We have custom implementation to find the pages / assets which do not have jcr:content.
It was working fine AEM 6.0 version but we are migrating to AEM 6,3 now and we are facing the below error when we open the page
Error during include of component '/apps/misc-tools/components/missingNode'
Error Message:
org.apache.sling.api.scripting.ScriptEvaluationException: org.apache.sling.scripting.jsp.jasper.JasperException:
Unable to compile class for JSP: An error occurred at line: 20
in the generated java file Only a type can be imported. com.day.cq.widget.HtmlLibraryManager resolves to a package
An error occurred at line: 24 in the jsp file: /apps/misc-tools/components/init/init.jsp HtmlLibraryManager cannot be resolved to a type 21: --%>
<%@include file="/libs/foundation/global.jsp" %>
<% 22: %><%@page import="com.day.cq.wcm.api.WCMMode,com.day.cq.widget.HtmlLibraryManager"%>
<% 23: //if (WCMMode.fromRequest(request) != WCMMode.DISABLED) {
24: HtmlLibraryManager htmlMgr = sling.getService(HtmlLibraryManager.class);
25: if (htmlMgr != null) {
26: htmlMgr.writeCssInclude(slingRequest, out, "cq.wcm.edit");
27: htmlMgr.writeJsInclude(slingRequest, out, "cq.wcm.edit");
Below is the code we have in init.jsp<%@include file="/libs/foundation/global.jsp" %><%
%><%@page import="com.day.cq.wcm.api.WCMMode,com.day.cq.widget.HtmlLibraryManager"%><%
//if (WCMMode.fromRequest(request) != WCMMode.DISABLED) {
HtmlLibraryManager htmlMgr = sling.getService(HtmlLibraryManager.class);
if (htmlMgr != null) {
htmlMgr.writeCssInclude(slingRequest, out, "cq.wcm.edit");
htmlMgr.writeJsInclude(slingRequest, out, "cq.wcm.edit");
}
String dlgPath = null;
if (editContext != null && editContext.getComponent() != null) {
dlgPath = editContext.getComponent().getDialogPath();
}
//}
%>
Tried downloading the dependency for com.day.cq.widgets but it also throws below error
[INFO] ------------------------------------------------------------------------
Could not find artifact com.adobe.granite:com.day.cq.widget:jar:6.0.0 in adobe-public-releases (https://repo.adobe.com/nexus/content/groups/public)
Can anyone help me on this
Thanks in advance ,
Premchand