Nivel 1
Nivel 2
Iniciar sesión en la comunidad
Iniciar sesión para ver todas las insignias
Hi All,
I have created helper class and written some of the utilities as part of it.Now when i am trying to access this inside my sightly component HTML ,getting below exception.
com.xxxx.dcom.sightly.helpers.components.HomePageBannerComponent POJO.
io.sightly.java.compiler.CompilerException: java.lang.ClassNotFoundException: com.xxxx.dcom.sightly.helpers.components.HomePageBannerComponent
at io.sightly.java.compiler.SightlyCompileServiceImpl.loadObject(SightlyCompileServiceImpl.java:137)
at io.sightly.java.compiler.SightlyCompileServiceImpl.getInstance(SightlyCompileServiceImpl.java:80)
at io.sightly.java.engine.extension.use.PojoUseProvider.provide(PojoUseProvider.java:65)
at io.sightly.java.engine.extension.use.UseExtension$1.call(UseExtension.java:82)
at io.sightly.java.runtime.common.SightlyRuntimeImpl.call(SightlyRuntimeImpl.java:51)
at apps.dcom.dm.components.content.contentsection.homepagebanner.SightlyJava_homepagebanner.render(SightlyJava_homepagebanner.java:50)
at io.sightly.java.api.BaseRenderUnit.render(BaseRenderUnit.java:39)
at io.sightly.java.engine.SightlyScriptEngine.evaluateScript(SightlyScriptEngine.java:109)
at io.sightly.java.engine.SightlyScriptEngine.eval(SightlyScriptEngine.java:93)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)
Thanks,
Kishore
¡Resuelto! Ir a solución.
Vistas
Respuestas
Total de me gusta
Can you follow this article and see if that works:
https://helpx.adobe.com/experience-manager/using/creating-sightly-component.html
This will tell us if your issue is your environment. If this works - we can rule out an environment issue.
Vistas
Respuestas
Total de me gusta
Hey Kishore -- looks like the Java class you are using for the Sightly component cannot be found. 2 things to check:
1 - is the helper class extend com.adobe.cq.sightly.WCMUse?
2 - is the bundle that you placed the class in an active state?
For those reading this thread and wanting to know how to use Sightly and Java together - see this AEM Community article:
https://helpx.adobe.com/experience-manager/using/creating-sightly-component.html
We have more advanced Sightly ones too - for example:
Creating a Sightly component that uses the AEM QueryBuilder API
Creating an AEM Sightly movie component
All of these show using Sightly on front end with Java on backend.
Hope this helps
Vistas
Respuestas
Total de me gusta
Also - this months Ask the Experts is exactly this topic. If you are interested in knowing about AEM and Sightly - sign up here:
http://scottsdigitalcommunity.blogspot.ca/2016/03/ask-aem-community-experts-deep-dive.html
Vistas
Respuestas
Total de me gusta
Apart from wht scott mentioned:
Which AEM version?
Show you code please from component and java
Make sure you are exporting package
Vistas
Respuestas
Total de me gusta
Hi Scott,
Thanks for the reply.
Helper class is implementing WCMUse interface and also bundle is activate state as well.
Syntax for getting this class inside sight component is as below.
<section data-sly-use.homePageBannerComponent="${'com.prj.dcom.sightly.helpers.components.HomePageBannerComponent'}"></section>
Thanks,
Kishore
Vistas
Respuestas
Total de me gusta
i am using AEM 6.0.0 version.
Thanks,
Kishore
Vistas
Respuestas
Total de me gusta
Thanks
Go to the bundle details and see whether you are exporting package and its present there
Vistas
Respuestas
Total de me gusta
Yes ,package of this class is listed in the exported packages of the bundle.
Vistas
Respuestas
Total de me gusta
Just wondering.....y these two class names are different
One in exception
io.sightly.java.compiler.CompilerException: java.lang.ClassNotFoundException: com.xxxx.dcom.sightly.helpers.components.HomePageBannerComponent
and one in sightly file
<section data-sly-use.homePageBannerComponent="${'com.prj.dcom.sightly.helpers.components.HomePageBannerComponent'}"></section>
Second thing....................
use this
<section data-sly-use.homePageBannerComponent="com.prj.dcom.sightly.helpers.components.HomePageBannerComponent">
instead of
<section data-sly-use.homePageBannerComponent="${'com.prj.dcom.sightly.helpers.components.HomePageBannerComponent'}">
Vistas
Respuestas
Total de me gusta
Please consider com.prj.dcom.sightly.helpers.components.HomePageBannerComponent this only.
And also i am seeing below error as well.
11.03.2016 00:53:30.565 *ERROR* [127.0.0.1 [1457637810506] GET /content/www/in/en.html HTTP/1.1] com.adobe.cq.sightly.WCMUse Failed to activate Use class
Thanks,
Kishore
Vistas
Respuestas
Total de me gusta
Can you follow this article and see if that works:
https://helpx.adobe.com/experience-manager/using/creating-sightly-component.html
This will tell us if your issue is your environment. If this works - we can rule out an environment issue.
Vistas
Respuestas
Total de me gusta
By the exception message it looks like the template engine is not able to access the mentioned class file. Could you please check once that you class is present in the OSGI and the bundle is also active. Not exactly sure though.
Regards
Tuhin
Vistas
Respuestas
Total de me gusta
Share the code for your WCM class in java
Vistas
Respuestas
Total de me gusta
Looks like it's a environmental issue.Checking it.
Vistas
Respuestas
Total de me gusta
Vistas
me gusta
Respuestas
Vistas
me gusta
Respuestas
Vistas
me gusta
Respuestas