Highlighted

Default Sling Script Error

Avatar

Avatar

berni7473

Avatar

berni7473

berni7473

07-02-2019

Hi everyone,

I am doing an update for a component in which I need to add a new class in the backend. On adding the class and making the required updates in the pom.xml files I am still getting the following error :

org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: No use provider could resolve identifier com.aem.community.core.demoClass

I also tried changing the name of the class and adding the packages in the pom. I even tried changing the artifactid from uppercase to lowercase however the error still persists :

org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.scripting.sightly.SightlyException: Compilation errors in org/apache/sling/scripting/sightly/apps/DeviceSupportPage/components/content/helloworld/helloworld_html.java:

Line 28, column 1289 : Only a type can be imported. com.aem.community.core.Democlass resolves to a package

Line 55, column 2410 : Democlass cannot be resolved to a type

Can anyone please guide me on this as to why such an error comes on drag and drop of the component?

Thanks and Regards,

Bernadine Soman

smacdonald2008Feike Visser

Replies

Highlighted

Avatar

Avatar

Feike_Visser1

Employee

Avatar

Feike_Visser1

Employee

Feike_Visser1
Employee

07-02-2019

I would expect DemoClass.

Can you share your HTL code?

Highlighted

Avatar

Avatar

Feike_Visser1

Employee

Avatar

Feike_Visser1

Employee

Feike_Visser1
Employee

07-02-2019

this error 'No use provider could resolve identifier com.aem.community.core.demoClass' normally means:

- class can't be found

- bundle is not active

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

07-02-2019

AGree with Feike - make sure you are referencing the correct fully qualified class name in the HTL code and the bundle that contains this class is in ACTIVE State.