0 Replies Latest reply on Dec 26, 2008 12:20 AM by unni s

    EJB invokation happens locally event if remote lookup is per

    unni s Newbie

      Hi,

      I am having 2 jboss application server in which i am deploying same ear . From the fist application server I want to lookup and invoke the ejbs belongs to second application server.

      For that i am writing the following code

      Properties properties = new Properties();
       properties.put(Context.INITIAL_CONTEXT_FACTORY,
       "org.jnp.interfaces.NamingContextFactory");
       properties.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");
       properties.put(Context.PROVIDER_URL, "second jboss IP" + ":1099");
       context = new InitialContext(properties);
      
      Object objectRef = context.lookup("MyEjb");
      MyEjbHome myHome = (MyEjbHome) PortableRemoteObject.narrow(objectRef, MyEjbHome.class);
      MyEjbRemote myRemote = myHome .create();
      
      String x = myRemote .getVal();
      


      Even if i have given IP of remote jboss server while creating initial context, it is always invoking the EJB belongs to first jboss server.My first application server is also having corresponding ejbs deployed. If i am not having those EJB in my first application server remote lookup is performed.

      I am using jboss 3.2.7 and jdk 1.4

      Any help is appreciated

      Thanks & Regards

      unnis