开发者

EJB not getting injected into the tested servlet

开发者 https://www.devze.com 2023-01-23 06:41 出处:网络
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 tes

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 fail开发者_如何转开发ing 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消