overriding breadcrumb core component: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: No use provider could resolve identifier com.adobe.cq.wcm.core.components.models.Component

sreenu539

29-09-2020

I am overriding breadcrumb component by sling:resourceSuperType and when I include breadcrumb.html  with below html, it is failing at data-sly-use.component with below log errors. I have added following dependency to ui.apps, core, global pom files 

 

<dependency>
<groupId>com.adobe.cq</groupId>
<artifactId>core.wcm.components.core</artifactId>
<version>${core.wcm.components.version}</version>
<scope>provided</scope>
</dependency>

 

still issue persists, Do I need to import core models anywhere apart from pom.xml dependency imports.

 

I appreciate any help, thanks.

 

 

<nav data-sly-use.breadcrumb="com.trp.aem.iinvestor.piweb.core.models.Breadcrumb"
     data-sly-use.component="com.adobe.cq.wcm.core.components.models.Component"
     data-sly-use.template="core/wcm/components/commons/v1/templates.html"
     id="${component.id}"
     class="cmp-breadcrumb"
     aria-label="${'Breadcrumb' @ i18n}"
     data-sly-test="${breadcrumb.items.size > 0}">
    <ol class="cmp-breadcrumb__list"
        itemscope itemtype="http://schema.org/BreadcrumbList"
        data-sly-list.navItem="${breadcrumb.items}">
        <li class="cmp-breadcrumb__item${navItem.active ? ' cmp-breadcrumb__item--active' : ''}"
            itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
            <a href="${navItem.URL}"
               class="cmp-breadcrumb__item-link"
               itemprop="item"
               data-sly-unwrap="${navItem.active}">
                <span itemprop="name">${navItem.title}</span>
            </a>
            <meta itemprop="position" content="${navItemList.count}" />
        </li>
    </ol>
</nav>
<sly data-sly-call="${template.placeholder @ isEmpty=breadcrumb.items.size == 0, classAppend='cmp-breadcrumb'}"></sly>
org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: No use provider could resolve identifier com.adobe.cq.wcm.core.components.models.Component
	at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:510) [org.apache.sling.scripting.core:2.0.56]
	at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:552) [org.apache.sling.engine:2.6.20]
	at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44) [org.apache.sling.engine:2.6.20]
	at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:82) [org.apache.sling.engine:2.6.20]
	at com.day.cq.wcm.core.impl.WCMDeveloperModeFilter.doFilterWithErrorHandling(WCMDeveloperModeFilter.java:164) [com.day.cq.wcm.cq-wcm-core:5.12.106]
	at com.day.cq.wcm.core.impl.WCMDeveloperModeFilter.doFilter(WCMDeveloperModeFilter.java:135) [com.day.cq.wcm.cq-wcm-core:5.12.106]
	at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.6.20]
	at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:192) [com.day.cq.wcm.cq-wcm-core:5.12.106]
	at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:159) [com.day.cq.wcm.cq-wcm-core:5.12.106]
	at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.6.20]
	at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:278) [com.day.cq.wcm.cq-wcm-core:5.12.106]
	at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.6.20]
	at com.day.cq.wcm.core.impl.page.PageLockFilter.doFilter(PageLockFilter.java:91) [com.day.cq.wcm.cq-wcm-core:5.12.106]
	at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.6.20]
	at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:94) [com.day.cq.cq-personalization:5.12.38]
	at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.6.20]
	at com.adobe.granite.csrf.impl.CSRFFilter.doFilter(CSRFFilter.java:217) [com.adobe.granite.csrf:1.0.20.CQ650-B0002]
	at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72) [org.apache.sling.engine:2.6.20]
	at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:282) [org.apache.sling.engine:2.6.20]
	at org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProcessorImpl.java:322) [org.apache.sling.engine:2.6.20]
	at org.apache.sling.engine.impl.request.SlingRequestDispatcher.dispatch(SlingRequestDispatcher.java:211) [org.apache.sling.engine:2.6.20]
	at org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatcher.java:104) [org.apache.sling.engine:2.6.20]
	at com.day.cq.wcm.core.impl.WCMComponentFilter$ForwardRequestDispatcher.include(WCMComponentFilter.java:516) [com.day.cq.wcm.cq-wcm-core:5.12.106]
	at com.adobe.cq.sightly.WCMScriptHelper.includeResource(WCMScriptHelper.java:179) [com.adobe.cq.sightly.cq-wcm-sightly-extension:1.6.0]
	at com.adobe.cq.sightly.internal.extensions.ResourceExtension.call(ResourceExtension.java:138) [com.adobe.cq.sightly.cq-wcm-sightly-extension:1.6.0]
	at org.apache.sling.scripting.sightly.impl.engine.runtime.RenderContextImpl.call(RenderContextImpl.java:77) [org.apache.sling.scripting.sightly:1.1.2.1_4_0]
	at org.apache.sling.scripting.sightly.apps.core.wcm.components.container.v1.container.simple_html$1.render(simple_html.java:190)
	at org.apache.sling.scripting.sightly.render.RenderUnit.render(RenderUnit.java:50) [org.apache.sling.scripting.sightly.runtime:1.1.0.1_4_0]
	at org.apache.sling.scripting.sightly.render.RenderUnit.callUnit(RenderUnit.java:87) [org.apache.sling.scripting.sightly.runtime:1.1.0.1_4_0]
	at org.apache.sling.scripting.sightly.apps.core.wcm.components.container.v1.container.container_html.render(container_html.java:69)
	at org.apache.sling.scripting.sightly.render.RenderUnit.render(RenderUnit.java:50) [org.apache.sling.scripting.sightly.runtime:1.1.0.1_4_0]
	at org.apache.sling.scripting.sightly.impl.engine.SightlyCompiledScript.eval(SightlyCompiledScript.java:60) [org.apache.sling.scripting.sightly:1.1.2.1_4_0]
	at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:386) [org.apache.sling.scripting.core:2.0.56]
	at 

 

 

  

Accepted Solutions (1)

Accepted Solutions (1)

Manjunathh

29-09-2020

Hi @sreenu539 

Even i got this error when i tried to use core component (com.adobe.cq.wcm.core.components.models.Component) with version <=2.8.0, after changing it to version >=2.9.0 & having this under embeddeds section along with project embed this error is resolved.

please try adding below mentioned changes in POM & this will resolve the issue.

 

Parent pom.xml :

<dependency>
<groupId>com.adobe.cq</groupId>
<artifactId>core.wcm.components.core</artifactId>
<version>2.9.0</version>
</dependency>

 

ui.apps pom.xml :

<embeddeds>
<embedded>
<groupId>${project}</groupId>
<artifactId>${project}</artifactId>
<target>/apps/${project}/install</target>
</embedded>
<embedded>
<groupId>com.adobe.cq</groupId>
<artifactId>core.wcm.components.core</artifactId>
<target>/apps/${project}/install</target>
</embedded>
</embeddeds>


<dependency>
<groupId>com.adobe.cq</groupId>
<artifactId>core.wcm.components.core</artifactId>
</dependency>

 

 

Answers (0)