views:

120

answers:

1

I am not sure jndi lookup is necessary or not in terms of ejb3 technology advantages. Any help would be appreciated, thanks.

+3  A: 

Yes you need to. But you can use annotations for this.

@EJB private BeanInterface yourbean

It will be injected for you. Make sure your interface is also annotated with @Local or @Remote. It depends on where you deploy to if you need to specify the jndi name in a config file or not.

Albert
Firstly many thanks for your reply. However, can you explain that did you mean whether I dont have to do any jndi lookup (ctx.lookup(bla bla)) or I have to do it but not have to call any managed bean method, because with @EJB anno. injection will be enough for it?By the way, my app. runs on jboss 4.2; is @EJB annotation (and also related ones about injection at all) capable with jboss4.2? Thanks a lot again.Baris
Bariscan