활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
Hi All,
I have created a class which extends WCMUsePojo. But it's not working, it is giving following error.
com.adobe.cq.sightly.WCMUsePojo Failed to activate Use class
java.lang.NullPointerException: null
This is the code:
import com.adobe.cq.sightly.WCMUsePojo;
public class TestUse extends WCMUsePojo {
String text;
@Override
public void activate() throws Exception {
text = get("text", String.class);
log.debug("Text: {}", text);
log.info("--- Started : : Activate");
}
public String getText (){
return this.text;
}
}
I have also included uber.jar in the pom.and the bundle is in the active state.
Please help me to resolve this issue.
해결되었습니다! 솔루션으로 이동.
Thanks All, the issue is solved. The acs-commons bundle is causing the issue because of twitter dependency. It is working fine after adding twitter bundle and restarting the core bundle.
조회 수
답글
좋아요 수
I think it is because of log.debug. I don't see creating an instance for the Logger class in your code.
You should be seeing line no where NPE is occuring, can you check?
Also is that the complete code?
Make sure you bundle is resolved in felix
조회 수
답글
좋아요 수
Hi,
Please check Adobe Experience Manager Help | Creating an Adobe Experience Manager HTML Template Language componen... to see how to use WCMUsePojo
조회 수
답글
좋아요 수
How are you deploying bundle ? are you deploying through Felix console ? or did use CRXDE to create a class? please post entire code?
Try below code : to read value from dialog we should use below code
getProperties().get("text", String.class);
I think get is used when you pass a parameter from sightly. this caused null pointer exception
get("text", String.class);
Hi Prashanth,
Have you checked this article which tells how to use WCMUsePojo class
Thanks,
Ratna Kumar.
조회 수
답글
좋아요 수
Can you share the full stacktrace? And also the code seems not to be complete.
조회 수
답글
좋아요 수
Thanks All, the issue is solved. The acs-commons bundle is causing the issue because of twitter dependency. It is working fine after adding twitter bundle and restarting the core bundle.
조회 수
답글
좋아요 수
Good to hear, although I can't see how this bundle can affect this.