Expand my Community achievements bar.

getting error which whicle developing the componenet

Avatar

Level 6

Hi Team,

Always getting  below error whicle developing the componenet.

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/restCo mponent_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(S ightlyJavaCompilerService.java:183) [org.apache.sling.scripting.sightly:1.0.48.1_3_1]

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

at org.apache.sling.scripting.sightly.impl.engine.SightlyScriptEngine.compile(SightlyScriptE ngine.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:4 91) [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/restCo mponent_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(S ightlyJavaCompilerService.java:173) [org.apache.sling.scripting.sightly:1.0.48.1_3_1]

... 249 common frames omitte

Need to know why this exception is getting for all the components

This excepting is getting for me when i add the HTL code.

<style>

 

 

h2 {

    display: inline;

}

img{

    float:left;

}

 

 

</style>

<h2>Current Issue</h2>

<div

    data-sly-use.multiItems="aem.community.mf.core.models.Multifield">

    <div data-sly-list.head="${multiItems.products.listChildren}">

        <div style="height:250px;"><img src=${head.pathbr} height=200 width=270 style="padding:4px"/><h2>${head.product}</h2>

                             <p>${head.desc}</p>

                             </div>

                             <hr>

   </div>

</div>

Please help by this error i'm  not able to develop components

Regards

Manikantha R

.

7 Replies

Avatar

Level 10

Follow this article to learn how to successfully build a component that uses HTL and a Java class.

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

Do each step in this article and you will see it working.

Avatar

Level 10

I just tested the package on 64 and it works perfectly. Please go through that article and you will see how a component written in HTL works.

HTLFeb.png

Avatar

Level 10

It seems to be same issue that happened couple of days back for same code and the root cause was wrong maven archetype

getting error whcih developing component

Please validate that correct versions are used.

Avatar

Level 10

Also - in the above Article - there is a package that you can install. You can see the working component there.

Avatar

Level 6

Hi 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/

Mvn version is below

1686250_pastedImage_0.png

I have checked the package manager and i have found two package are having dependency.

1686251_pastedImage_1.png

Whether this will create any issue that error.

Regards

Manikantha R

Avatar

Level 10

It would be better to install these packages to avoid any runtime issues. You may also try with a lower mvn version. Not sure if that could be an issue.

You may share your code package for testing.

Avatar

Level 6

Hi gaurav,

How to upload the package in this forum,

i'm not getting the option for that.

Please let me know how i can share the package.

Regards

Manikantha R