This content has been marked as final.
Show 2 replies
-
1. Re: Accessing stateless EJB3 bean from a WAR
michael.litherland Jul 21, 2008 4:05 PM (in response to michael.litherland)I almost hate to point this out because it might confuse things, but if I don't use the EJB injection I can get things to work:
// @EJB(name="java:comp/env/ejb/MyBean") private MyBeanRemote mbr; private Logger logger = Logger.getLogger(MainForm.class.getSimpleName()); public MainForm() { try { Context c = new InitialContext(); Object obj = c.lookup("jnp://localhost:1099/custom/remote/MyBean"); mbr = (MyBeanRemote) PortableRemoteObject.narrow(obj, MyBeanRemote.class); } catch (NamingException e) { logger.log(Level.SEVERE, "Naming Exception", e); }
-
2. Re: Accessing stateless EJB3 bean from a WAR
jaikiran Jul 22, 2008 2:47 AM (in response to michael.litherland)on a JBoss 4.2.2 application server
Mike,
JBoss-4.2.2 doesn't allow EJB injection in the web-tier. There's a sticky note in this forum, which has this discussion http://www.jboss.com/index.html?module=bb&op=viewtopic&t=107353. Since you mention, you are using JSF, the post dated Thu Apr 26, 2007 11:13 AM by Wolfgang Knauf, in that thread, might be of some help.