Highlighted

HtmlLibraryManager cannot be resolved to a type

Avatar

Avatar

premchandr61956

Avatar

premchandr61956

premchandr61956

30-03-2018

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

Replies

Highlighted

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

31-03-2018

Trying to consume the AEM strongly typed APIs in 6.3 in JSP is older development pattern. Rework this component and use the AEM UBER 6.3 JAR file. Also we recommend converting your components to HTL and move away from JSP.

Highlighted

Avatar

Avatar

Chaitanya96

Avatar

Chaitanya96

Chaitanya96

16-04-2018

I am using AEM uber 6.3 Jar file. Bundle is resolved but i am getting similar exception

An error occurred at line: 25 in the generated java file

Only a type can be imported. com.day.cq.widget.HtmlLibraryManager resolves to a package

Tried recompiling all jsp, however no luck. Is there any suggestion you can provide?

Thanks,

Chat

Highlighted

Avatar

Avatar

Vijayalakshmi_S

MVP

Avatar

Vijayalakshmi_S

MVP

Vijayalakshmi_S
MVP

16-04-2018

Hi,

Please note that com.day.cq.widget.HtmlLibraryManager is deprecated since 6.1, replacement for the same - com.adobe.granite.ui.clientlibs.HtmlLibraryManager

HtmlLibraryManager ("The Adobe AEM Quickstart and Web Application.")