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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...