简体   繁体   中英

How to inject a Stateless Session Bean into a Message Driven Bean?

I'm trying to inject a remote stateless session bean in a message driven bean.

I've been looking this post: How to inject a Session Bean into a Message Driven Bean?

The Session Bean and the Message Driven Bean are in two diff.

Here an exemple of what i've tried to inject my EJB :

@EJB(beanName="TraitementBeanRemote")
private TraitementBeanRemote traitementBeanRemote;

The application throws a NamingException :

javax.naming.NamingException: Lookup failed for '#com.generator.traitement.TraitementBeanRemote' in SerialContext

My environement : Netbeans 7.4 / Glassfish 4.0

Does someone have any idea about that?

If this Session Bean is deployed on the same server, then I recoment to add to it a local interface. EJB can have @Remote and @Local interfaces at the same time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM