Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

In author local instance, receiving 500 org.apache.sling.sightly.SightlyException error

Avatar

Level 2

When I try to View as Published in author local, I get the following error:

org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.scripting.sightly.SightlyException: Compilation errors in org/apache/sling/scripting/sightly/apps/xxxx__002d__xxxx/components/breadcrumb/breadcrumb__002e__html.java: Line 136, column 7788 : com.xxxx.xxxx.core.models.BreadCrumbModel cannot be resolved to a type

Cannot serve request to /content/xxxx-xxxx/us/en/home/test.html in /apps/xxxx-xxxx/components/breadcrumb/breadcrumb.html

 

Not sure how to troubleshoot, I appreciate any and all help. Thanks!

15 Replies

Avatar

Community Advisor

@kbsniquer : Please check if your bundles are up and Active. Specifically check the bundle where you have defined the BreadCrumbModel sling model class.
I am sure there are some errors and once you resolve them and bundle(s) are in Active status, the errors would go away.

thanks.

Avatar

Level 2

Thank Kamal.

I'm checking the bundles and see that the core one, that has defined the BreadCrumbModel sling model class, is Installed but not Active. Can you advise how to resolve an issue like this?

Avatar

Level 4

Hi @kbsniquer You can expand the OSGI bundle and check for any missing dependencies (in red) if there are any.

 

Regards,

Ayush

Avatar

Level 2

I see three dependencies in red in that bundle. I am very new at this. Can you advise how to fix?

Avatar

Level 4

Hi @kbsniquer Could you please share screenshot for the same.

 

Regards

Ayush

Avatar

Level 2

These are in red:

com.adobe.cq.dam.cfm,version=[1.12,2) -- Cannot be resolved

com.adobe.cq.wcm.core.components.models,version=[12.26,13) -- Cannot be resolved org.apache.sling.api.request,version=[2.7,3) -- Cannot be resolved

Avatar

Level 4

Hi @kbsniquer Could you please also let us know the AEM version which you are using.

If on AEM Cloud you can check out this question (https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/import-of-com-adobe-cq-wcm...).

If you are using non cloud version then you might need to check the version which is exported from the uber-jar. You might also need to check your pom.xml if you have added dependency for these packages. It should be the same as uber-jar

Avatar

Level 2

I use AEM as a Cloud Service.

I'll check the question above. Thank you...

Avatar

Level 4

Hi @kbsniquer Can you check if the bundle is in active state (http://localhost:4502/system/console/bundles). Also you can check if the sling model is registered here (http://localhost:4502/system/console/status-slingmodels) and you are using the same package name in the sightly code.

 

Regards,

Ayush

Avatar

Community Advisor

As clear from log that it is a compilation error on html 

Compilation errors in org/apache/sling/scripting/sightly/apps/xxxx__002d__xxxx/components/breadcrumb/breadcrumb__002e__html.java: Line 136, column 7788 com.xxxx.xxxx.core.models.BreadCrumbModel

cannot be resolved to a type

check breadcrumb.html if the Java class that you are calling is correct? 

com.xxxx.xxxx.core.models.BreadCrumbModel

 

can you also share how you are calling Java class on html?

 

Avatar

Community Advisor

There can be below things:

1. Check if specific bundle is active

2. It can be n issue with Breadcrum sling models. It is not able to properly injected due to some invalid code written within slimg model.

3. Did we provide the correct package and Class name in sightly.

4. There can be any issue with on of the service which is getting reference in Breadcrumn model 

5. Some dependency bundles are not available.

 

It can be 4th and 5th point in your case

Avatar

Community Advisor

@kbsniquer @Please share screenshot for the bundle having dependency in red.

Goto /console/bundles.. select project having breadcrumb class, click on that project and check if something highlighted there in red

Avatar

Level 2

These are in red:

com.adobe.cq.dam.cfm,version=[1.12,2) -- Cannot be resolved
com.adobe.cq.wcm.core.components.models,version=[12.26,13) -- Cannot be resolved

org.apache.sling.api.request,version=[2.7,3) -- Cannot be resolved

Avatar

Administrator

@kbsniquer Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni