kiransri
kiransri

Reputation: 25

EJB not getting injected into the tested servlet

I am using Cactus to test a servlet which has an injected ejb (EJB 3.0) using @EJB annotation. The servlet is working fine when executed as part of the web application but while running the cactus test it is failing to inject the ejb. I am getting a null pointer exception. Please let me know if there is any limitation of ejb dependency injection in cactus.

Upvotes: 0

Views: 434

Answers (1)

kiransri
kiransri

Reputation: 25

I was using new to instantiate the servlet and hence it was not being managed by the container. I have corrected this issue. thanks for your time and help

Upvotes: 1

Related Questions