3 Replies Latest reply on Dec 17, 2009 3:09 AM by jaikiran pai

    EJB 3.1: Injecting remote session beans using @EJB?

    Mike Johnson Newbie

      I recently downloaded 6.0.0M1 and am playing with EJB 3.1.  I'd like to set up the following scenario:

       

      - I have two JBoss AS instances running on two separate machines

      - Server "S" serves out a stateless session bean with a remote interface

      - Server "C" has a stateless session bean that needs to make a call to the remote bean in server "S"

       

      I've seen samples where server "C" can look up the bean in server "S" using a Context.lookup(...) call.  I'd rather use the "@EJB" annotation here though.  I have seen that the EJB spec implies that I should be able to use @EJB for injecting a remote bean.

       

      My question is -- where is the magic that says that the remote bean is "served" from server "S"?  I was thinking maybe there would be some kind of XML config file that says "for remote bean interface XYZ, use the bean named 'Bean S' running on server S..." ?

       

      Thanks in advance,

      Mike Johnson