Expand my Community achievements bar.

SOLVED

cannot be correctly instantiated by the Use API

Avatar

Level 2

Hi @here,

can someone help me with this error.

Screenshot 2022-12-12 at 12.45.02 PM.png

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Mohit1, There are many reason due to which you User API can not instantiated. Like your Sling model is not using injection strategy as optional, Some exception or error in your post construct method, any issue in any services that you are using into you sling model.

You log says you are getting null pointer in CommonHelper.java at line#1105.

Once you correct this, this issue will get resolved.

Hope this helps.

Umesh Thakur

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

Hi @Mohit1, There are many reason due to which you User API can not instantiated. Like your Sling model is not using injection strategy as optional, Some exception or error in your post construct method, any issue in any services that you are using into you sling model.

You log says you are getting null pointer in CommonHelper.java at line#1105.

Once you correct this, this issue will get resolved.

Hope this helps.

Umesh Thakur

Avatar

Employee Advisor

hi @Mohit1 ,

 

Can you share your model code , which can provide more insight to the issue.

 

Thanks,

Nikita Garg

Avatar

Community Advisor

@Mohit1 It seems to be related to the sling model you are using, debugging and clearing the exception should ideally solve the propblem.