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.
SOLVED

getting error whcih developing component

Avatar

Level 6

Hi Team,

I have developed the component but  always i'm getting below error

Caused by: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.scripting.sightly.SightlyException: Compilation errors in org/apache/sling/scripting/sightly/apps/restHTL64/components/content/restComponent/restComponent_html.java:

Line 28, column 1284 : Only a type can be imported. com.community.rest.core.HeroRestComponent resolves to a package

Line 42, column 1916 : HeroRestComponent cannot be resolved to a type

at org.apache.sling.scripting.sightly.impl.engine.SightlyJavaCompilerService.compileSource(SightlyJavaCompilerService.java:183) [org.apache.sling.scripting.sightly:1.0.48.1_3_1]

at org.apache.sling.scripting.sightly.impl.engine.SightlyScriptEngine.internalCompile(SightlyScriptEngine.java:157) [org.apache.sling.scripting.sightly:1.0.48.1_3_1]

at org.apache.sling.scripting.sightly.impl.engine.SightlyScriptEngine.compile(SightlyScriptEngine.java:89) [org.apache.sling.scripting.sightly:1.0.48.1_3_1]

at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:379) [org.apache.sling.scripting.core:2.0.54]

at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184) [org.apache.sling.scripting.core:2.0.54]

at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491) [org.apache.sling.scripting.core:2.0.54]

... 244 common frames omitted

Caused by: org.apache.sling.scripting.sightly.SightlyException: Compilation errors in org/apache/sling/scripting/sightly/apps/restHTL64/components/content/restComponent/restComponent_html.java:

Line 28, column 1284 : Only a type can be imported. com.community.rest.core.HeroRestComponent resolves to a package

Line 42, column 1916 : HeroRestComponent cannot be resolved to a type

at org.apache.sling.scripting.sightly.impl.engine.SightlyJavaCompilerService.compileSource(SightlyJavaCompilerService.java:173) [org.apache.sling.scripting.sightly:1.0.48.1_3_1]

... 249 common frames omitte

What could be the issue.

Please suggest from where issue is coming.

Regards

Manikantha R

1 Accepted Solution

Avatar

Correct answer by
Level 4

May be You are not using the correct archetype version while creating the project.Use archetype version 13 or higher if using AEM 6.4 or AEM 6.3 SP2. In case using AEM 6.3 then try with version 12.Also check if core. wcm-component package installed through the archetype is correct or not.While facing this issue I feel one of the bundle would be in stopped state.

View solution in original post

5 Replies

Avatar

Level 10

Are you using appropriate -

  • maven version
  • java compiler version
  • pom.xml libraries
  • check if .m2 dependencies are not corrupt

Avatar

Level 10

You must be doing something wrong. See if you can follow this basic article to develop a component.

Creating an Adobe Experience Manager 6.4 HTL component that uses the WCMUsePojo API

This has been tested many many times by a lot of community members and it works.

Avatar

Correct answer by
Level 4

May be You are not using the correct archetype version while creating the project.Use archetype version 13 or higher if using AEM 6.4 or AEM 6.3 SP2. In case using AEM 6.3 then try with version 12.Also check if core. wcm-component package installed through the archetype is correct or not.While facing this issue I feel one of the bundle would be in stopped state.

Avatar

Level 6

Hi Negi,

i have used below command to create the Project.

mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeArtifactId=aem-project-archetype -DarchetypeVersion=13 -DarchetypeCatalog=https://repo.adobe.com/nexus/content/groups/public/

I have checked the package manager and below  2 componenets are dependency.

Whether it will cretae any issue.

1686144_pastedImage_0.png