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

Getting Null Pointer Exception while running the Junit test case

  • January 24, 2023
  • 2 replies
  • 12831 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

Umesh_Thakur
Umesh_ThakurAccepted solution
New Participant
January 24, 2023
Nandheswara
New Participant
January 24, 2023

Thanks @umesh_thakur  it is really helpful.

Anudeep_Garnepudi
New Participant
January 24, 2023

@nandheswara 

 

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