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();