0 Replies Latest reply on Sep 4, 2008 2:28 PM by triumphthepup

    EJB3 References (ejb-ref)

    triumphthepup

      We're deploying an EAR with an EJB jar in it. We're then trying to access those EJBs from another WAR (standalone, not in the EAR) in the same JBoss instance. I'm having a difficult time finding documentation on what the "proper" JEE approach is for how servlets etc. in the separate WAR should be getting ahold of those EJBs.

      I can successfully get ahold of the EJBs from the separate WAR using the Global JNDI name for example....

      InitialContext ctx = new InitialContext();
      SimpleService service = (SimpleService)ctx.lookup("simple-ear/SimpleServiceImpl/local");
      etc....
      


      However, if I understand correctly, according to the JEE / EJB3 specs I should have ejb-local-ref entries in my war.xml etc. for mapping to logical names, etc. I've read the spec but it's not clear how much of that is required for EJB3 vs. legacy stuff from EJB2.

      I can't seem to find a simple example of what all of the proper configuration elements are for doing this in JBoss (4.2.3). It sounds like I need an ejb-jar.xml in my EAR and entries in my web.xml in my WAR?

      Can anyone suggest some straight forward examples / documentation that illustrate what I'm trying to do? Thanks!!