[jboss-user] [EJB 3.0] - Re: EJB Annotation question?

polesen do-not-reply at jboss.com
Wed Dec 6 15:20:56 EST 2006


You do not mention in which context you've put the @EJB annotation that fails, but judging from the "public static void main..." code in your example, it seems to be outside container code in a client application. @EJB annotations does not work there. In clients, you (still) need to do JNDI lookups.

You can only inject ejbs in certain supported classes, like EJB implementations and servlets. Actually, you cannot in servlets but that is a JBoss issue (see: http://docs.jboss.org/ejb3/app-server/tutorial/ear/ear.html) even though you should be able to.

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

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



More information about the jboss-user mailing list