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
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to