Hi. I still didn't resolve my problem. I forget to mentioned I am using Jboss 5 app. server.
Is my question so stupid and my mistake so obvious, that everyone loath on it or what? If so I would appreciate a little help to pint me at. Thanks
well that is a problem.JBoss DID bind EJB under specified name. Every time when I try to use DI I got NullPointerException?! Even if it display the same jndi name it had bound to.
The ONLY way I retrieved an EJB in the servlet was using JNDI lookup, but ONLY yhis way :
Every attempt using java:comp/env, or any other binding I have read from Ejb in Action like
had resulted with an exception that bean isn't bound!
Why I get a NullPointerException, when I perform DI in servlet that is a question???
Well, it is little messy what you wrote here
but, I put my interface as. and this is injection in servlet
Into JMX Agen I saw that each ejb bean has been deplopyed
Still, I get
If I perform lookup I have describe, it is fine. I obtain EJB in my servlet, I CAN inject other beans into another beans using @EJB DI. But I,just as I said, I continuously receive when I try to inject bean into servlet....
Well, I would be bewildered if there are some gremlins in my pc. no really... But it doesn't matter. I will answer on scbcd that it CAN be injected, even if I cannot perform such a thing
nope, it wont.
The difference is that now I got NullPointerException, unlike previously where any attempt obtaining a bean from servlet using jndi lookup (different but my way) was result a NamingException.
Use of @EJB annotation produce each time NullPointerException.
So, doesn't matter, I'm gonna use my way to obtain a reference from servlet, but I'm just in confusion, why "book-example-of-ejb-obtaining", wont work at my pc?
Thanks anyway on your efforts!
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop