Getting Null Pointer Exception while running the Junit test case | Community
Skip to main content
Nandheswara
Level 4
January 24, 2023
Solved

Getting Null Pointer Exception while running the Junit test case

  • January 24, 2023
  • 2 replies
  • 12866 views

Hi all,

I created the Junits test case for one of my simple return method but while trying to run the junit test case it throws an Null Pointer Exception as below screen shot, please give some suggestion for resolving this error.

 

 

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 Umesh_Thakur

@nandheswara ,

Please see below blogpost, hope this helps

https://aemhelper.blogspot.com/2022/03/common-cause-of-nullpionterexception-or.html

2 replies

Anudeep_Garnepudi
Community Advisor
Community Advisor
January 24, 2023

@nandheswara 

 

Your Sling Model is failing to initialize. Check all injectors in Sling Model are configured in JSON. 

AG
Umesh_Thakur
Community Advisor
Umesh_ThakurCommunity AdvisorAccepted solution
Community Advisor
January 24, 2023
Nandheswara
Level 4
January 24, 2023

Thanks @umesh_thakur  it is really helpful.