Error during include of component '/apps/wknd/components/content/helloworld' | Community
Skip to main content
New Participant
Jan 16, 2020 2:11 AM UTC
Solved

Error during include of component '/apps/wknd/components/content/helloworld'

Error Message:

org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Compilation errors in org/apache/sling/scripting/sightly/apps/wknd/components/content/helloworld/helloworld_html.java: Line 52, column 2348 : com.adobe.aem.guides.wknd.core.models.HelloWorldModel cannot be resolved to a type


Anyone have an idea to solve this error? 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
uroaAccepted solution
New Participant
Jan 16, 2020 5:11 AM UTC

Try deleting your bundle in OSGi and install it again. Go to your core directory and run this command:

 

mvn -PautoInstallBundle clean install

 

3 replies

ArpitVarshney
New Participant
Jan 16, 2020 5:24 AM UTC

Hi @jasonj45687155 

Can you make sure below point:

 

In order for these classes to be picked up, there is a header which must be added to the bundle's manifest(pom.xml):

<Sling-Model-Packages>
  org.apache.sling.models.it.models
</Sling-Model-Packages>

This header must contain all packages which contain model classes or interfaces. However, subpackages need not be listed individually, e.g. the header above will also pick up model classes in org.apache.sling.models.it.models.sub. Multiple packages can be listed in a comma-separated list (any whitespace will be removed):

<Sling-Model-Packages>
  org.apache.sling.models.it.models,
  org.apache.sling.other.models
</Sling-Model-Packages>

 Reference: https://sling.apache.org/documentation/bundles/models.html

 

Regards,

Arpit Varshney

Translate
uroaAccepted solution
New Participant
Jan 16, 2020 5:11 AM UTC

Try deleting your bundle in OSGi and install it again. Go to your core directory and run this command:

 

mvn -PautoInstallBundle clean install

 

Translate
New Participant
Jan 16, 2020 6:11 AM UTC
Thanks! It worked.
Translate