1 Reply Latest reply on Apr 26, 2007 7:58 AM by Stefan Meier

    Problems calling methods in session beans on second JBoss in

    Thorsten Hoffmann Newbie

      I have installed two JBoss instances on the same computer, and they both run fine. Now I tried to access a session bean on JBoss 2 from a session bean deployed in JBoss 1. For this purpose I use the following code:

      Properties jndiProps = new Properties();
      jndiProps.put(Context.PROVIDER_URL, "jnp://xxx.xxx.xxx.xxx:11099");
      jndiProps.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
      jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      Context ejbContext = new InitialContext(jndiProps);
      RemoteBeanHome remoteBeanHome = (RemoteBeanHome)ejbContext.lookup(jndiNameOfRemoteBean);

      The result is that the bean I tried to call in JBoss 2 is called within JBoss 1 (The bean is deployed on both JBoss instances).

      Any ideas why this is happening?

      By the way, I 'm using JBoss 3.2.7 and the files ejb-jar.xml and jboss.xml are the same on both servers. Is that the problem?

      Thanks in advance,