[size=12]I am developing simple application to understand better JMS. It turned out that I know very little of EJB injection too.
I am desperate after this day trying to inject one Message-Driven Bean into another stateful bean. Each attempt to deploy my app I have only mistakes. As I remember the first mistake of this was NameNotFoundException and after that long range of Exception subclasses.
Here is my mdb which has to be injected into another bean within the same folder even:
Here is my ejb that injects above mdb:
I have tried all possible attributes from @EJB. I tried to change web.xml as I found on the Internet. What I found is here:
Unfortunately this piece of code only encreased range of my mistakes! Also I tried to add there <lookup-name> element, then <mapped-name> but vainly!
Can anybody advise me what to set in my web.xml or EJBs to have my MDB injected into my stateful bean. I tried also to change stateful bean to stateless but it didn't make any difference! I tried to move from @EJB to @Resource annotation but it didn't help too.
Thank you very much for any ideas!
True person is moral, false is right!
posted 3 years ago
As far as I know it is not possible to inject MDB instance into another bean because MDB are invisible for the clients. You can only get a reference to a Queue or Topic the MDB is listening.