getting error whcih developing component | Community
Skip to main content
manikanthar1295
Level 5
Jan 14, 2019 2:55 PM UTC
Solved

getting error whcih developing component

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.
Rohit-Negi
Rohit-NegiAccepted solution
Level 3
Jan 14, 2019 9:29 PM UTC

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

manikanthar1295
Level 5
Feb 7, 2019 10:06 AM UTC

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.

Translate
Rohit-Negi
Rohit-NegiAccepted solution
Level 3
Jan 14, 2019 9:29 PM UTC

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.

Translate
smacdonald2008
Level 10
Jan 14, 2019 8:01 PM UTC

Just tested on 6.4 - output:

Translate
smacdonald2008
Level 10
Jan 14, 2019 7:53 PM UTC

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.

Translate
Gaurav-Behl
Level 10
Jan 14, 2019 3:50 PM UTC

Are you using appropriate -

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