EntityManager not getting injected in EJB, resulting in NullPointerException

am new to J2EE and have been trying to resolve this issue from almost a week. This is the code in my session bean where in I am getting a NullPointerException. Found out that the entity manager is not getting injected. Can anyone pllllzzzz lemme know how to resolve it.

Hi,
Sorry am new to the forum, added the code tags.
This is the last 2 lines from the stack trace.
SEVERE: java.lang.NullPointerException at session.UserFacade.validateUser(UserFacade.java:56)
I am getting the Null Pointer Exception in this line

From the msgs that I have printed out, it shows that em is null.
Could you please lemme know what am I missing

Thanks,

Ranganathan Kaliyur Mannar wrote:Hi,
Please UseCodeTags when posting code. Click on the link to understand how to do that.

You have indicated you have a NullPointerException. Please provide the stack trace as that would point to the line where this happens: TellTheDetails.