getting error whcih developing component | Community
Skip to main content
manikanthar1295
Level 5
January 14, 2019
Solved

getting error whcih developing component

  • January 14, 2019
  • 5 replies
  • 3919 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Rohit-Negi

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.

5 replies

Gaurav-Behl
Level 10
January 14, 2019

Are you using appropriate -

  • maven version
  • java compiler version
  • pom.xml libraries
  • check if .m2 dependencies are not corrupt
smacdonald2008
Level 10
January 14, 2019

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.

smacdonald2008
Level 10
January 14, 2019

Just tested on 6.4 - output:

Rohit-Negi
Rohit-NegiAccepted solution
Level 3
January 14, 2019

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.

manikanthar1295
Level 5
February 7, 2019

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.