3 Replies Latest reply on Oct 3, 2006 3:25 AM by stnor

    SLSB with @Local and @Remote gets Remote Proxy in @EJB injec

    stnor

      If we declare a Bean class to use both @Remote and @Local the intra-JVM calss server calls are made using the remote interface if using @EJB in another SLSB. Why?

      public interface FooApi {
      String hello(String name);
      }

      @Remote(FooApi .class)
      @Local(FooApi .class)
      @Stateless
      public class FooApiBean implements FooApi {

      public String hello(String name) {
      return "hello " + name;
      }
      }

      public interface BarApi {
      String hello(String name);
      }

      @Remote(BarApi .class)
      @Stateless
      public class BarApiBean implements BarApi {

      @EJB FooApi foo; <--------- remote proxy is used here, why???

      public String hello(String name) {
      return foo.hello(name);
      }
      }

      Thanks,

      Stefan