3 Replies Latest reply on Jul 26, 2010 1:20 PM by Thomas Küstermann

    How to inject a remote EJB to a seam component

    Charlie Yang Novice
      I deploy a ejb application (an EAR contains an EJB JAR) in JBoss.
      One of the jndi name is ejbtest/HelloWorldImpl/remote.

      And I deploy a web application (a WAR) in another JBoss, this web app uses seam.
      There is a jndi.properties file in web app classpath.

      Now I want to inject the remote ejb to my seam backing bean(HelloWorldAction).

      I tried @EJB(mappedName="ejbtest/HelloWorldImpl/remote"), but not work.

      But I can use InitialContext.lookup to get the remote ejb proxy.

      Can I inject the remote ejb to seam component? And how?

      I use seam 2.2.0.GA and JBoss 5.1.0.GA.

      BTW, when I package the ejb and web module to one EAR, and deploy it in JBoss, I can use @In to inject the seam EJB component with jndi pattern(ejbtest/#{ejbName}/remote) defined in components.xml.