Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Error message "Cannot get DefaultSlingScript: Compilation errors in... cannot be resolved to a type" while creating a new component for the WKND tutorial


Level 2

I have created a new component for the WKND tutorial project. Its html file has the following code:


<sly data-sly-use.fragmentByURL="com.adobe.aem.guides.wknd.core.models.components.ContentFragmentByURL"
    <sly data-sly-call="${cfTemplates.contentFragment @ fragment=fragment, fragmentPath=fragmentByURL.fragmentPath, wcmmode=wcmmode}"></sly>
<sly data-sly-use.template="core/wcm/components/commons/v1/templates.html"
     data-sly-call="${template.placeholder @ isEmpty=!ready, classAppend='cq-dd-contentfragment'}"></sly>


I have created an interface that extends the interface ComponentExporter.


I have also created an implementation of my interface in


adaptables = {SlingHttpServletRequest.class},
adapters = {ContentFragmentByURL.class, ComponentExporter.class},
resourceType = {ContentFragmentByURLImpl.RESOURCE_TYPE},
defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL
@Exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, extensions = ExporterConstants.SLING_MODEL_EXTENSION)
public class ContentFragmentByURLImpl implements ContentFragmentByURL{

protected static final String RESOURCE_TYPE = "wknd/components/contentfragmentbyurl";

I have created a inside com.adobe.aem.guides.wknd.core.models.components.


I can generate the project and I can deploy it into a local AEM 6.5 instance.


If I go to http://localhost:4502/system/console/bundles I can see that my bundle "WKND Sites Project - Core (aem-guides-wknd.core)" is active.


If I go to http://localhost:4502/system/console/adapters I can see my adapters listed but the interface and its implementation appear in red color:




If I compare it with the Byline example from the WKND tutorial, the interfacte does not appear in red color:




If I go to http://localhost:4502/system/console/status-adapters I can see the interface and its implementation listed:


Providing Bundle:
Available Adapters:
 * com.adobe.aem.guides.wknd.core.models.components.ContentFragmentByURL
 * com.adobe.cq.export.json.ComponentExporter
 * com.adobe.aem.guides.wknd.core.models.components.impl.ContentFragmentByURLImpl


If I create a page and add my component, I get the following error:


31.10.2022 13:35:07.189 *ERROR* [ [1667219707133] GET /content/wknd/language-masters/en/detalle-de-fragmento-de-contenido-04/jcr:content/root/container/contentfragmentbyurl.html HTTP/1.1] Error during include of SlingRequestPathInfo: path='/content/wknd/language-masters/en/detalle-de-fragmento-de-contenido-04/jcr:content/root/container/contentfragmentbyurl', selectorString='null', extension='html', suffix='null' Cannot get DefaultSlingScript: Compilation errors in org/apache/sling/scripting/sightly/apps/wknd/components/contentfragmentbyurl/
Line 43, column 1927 : com.adobe.aem.guides.wknd.core.models.components.ContentFragmentByURL cannot be resolved to a type
at ...
Caused by: Compilation errors in org/apache/sling/scripting/sightly/apps/wknd/components/contentfragmentbyurl/
Line 43, column 1927 : com.adobe.aem.guides.wknd.core.models.components.ContentFragmentByURL cannot be resolved to a type
at ... 141 common frames omitted


Can anybody, please, spot what I am missing?


Thanks in advance.

6 Replies


Level 2

My local instance is an Adobe Experience Manager and I am using the latest WKND tutorial code available at


Community Advisor

Hi @manuel_óscars89,

I believe the implementation is not correct.

The proper way to extend Core Components model is to use delegation pattern. Here is the similar question answered, kindly have a look [0].


Hope that helps!




Level 2

Hi! I am not extending a Core Component. There is a project called Asset Share Commons ( in which they manage to show different images or videos using just one page instead of using one page per each image.




The way they have done this is by creating new components whose only purpose is to get an asset path for the URL suffix and then find that asset and render it.


I am trying to do the same for Content Fragments, which are another kind of asset in the DAM.


They did not extend the current Core Components but created new components. Here you can see a code example for images:


I am trying to replicate their success but for Content Fragments.


Thanks in advance for any help.




Hi Manuel,


glad to find a fellow sufferer... 😉

I'm facing exactly the same issue when trying to install Asset Share Commons on a Vanilla AEM 6.5 op-prem instance. I tried various combinations of Asset Share Commons (versions 2.1.12 to 2.4.6) and AEM 6.5  (version to but always got the same error.

Have you find out what caused the problem and got a solution?

Thanks for a hint,

AEMazing greetings,



Level 2

Hi Chris,


Sadly I was moved to a different project and I have not found the time to get back to it yet.


If you ever find the cause, please, do not hesitate to tell me. I still don't understand what is causing it.


Best of luck!

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now