[jboss-user] [EJB 3.0] - EJB Injection Question

Esclarmonde do-not-reply at jboss.com
Wed Jun 13 09:55:55 EDT 2007


Hello,

I have only recently started working with JBoss and EJB 3.0. Maybe I am missing something obvious. I have a stateless session bean which has to reference several other stateless session beans. 

Now my resources suggest that I use the @EJB annotation to achieve this. 


  | @Stateless
  | @Local(XLocal.class)
  | public class XBean implements X {
  |          
  |     @EJB YLocal y;
  |     ....
  |     
  | }
  | 
  | @Stateless
  | @Local(YLocal .class)
  | public class YBean implements Y {
  |     ....
  | }
  | 

Where XLocal and YLocal extend the X,Y interfaces ...

The injection in the XBean is not working. There are no error messages on deployment that look like they are related to this. Only "Incomplete Deployment listing" on a different MBean (probably a completely unrelated problem).

I used to use something like 

  | Context c = new InitialContext();
  | return (YLocal) c.lookup(".../YBean/local");
  | 

This has worked fine in the past. Now I wonder why the @EJB annotation is not working, as it looks easier to maintain. 

I would be very grateful for some hints what I am missing here.

Bye
Esclarmonde



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4053983#4053983

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4053983



More information about the jboss-user mailing list