2 Replies Latest reply on Aug 7, 2008 9:35 PM by zhuhuapeng

    local jboss  accessing EJB's deployed in remote jboss

    zhuhuapeng

      i want to have a web application named cattle_view.war in jboss 4.2.3[ip:10.0.0.8] and access to ejb container in remote machine[ip: 10.0.0.10] with jboss 4.2.3 .
      cattle_view.war and cattle_mode.jar can be run well in on machine.
      can some one help me about it,very thanks.

        • 1. Re: local jboss  accessing EJB's deployed in remote jboss
          jaikiran

          All you have to do is, use the correct JNDI properties and the jndi-name for the EJB lookup. Something like:

          Properties props = new Properties();
          props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
          props.put(Context.PROVIDER_URL,"jnp://10.0.0.10:1099"); //1099 is the default. change the port number appropriately.
          props.put(Context.URL_PKG_PREFIXES,"org.jboss.naming.jnp.interfaces");
          Context ctx = new InitialContext(props);
          
          MyBeanRemoteInterface bean = (MyBeanRemoteInterface) ctx.lookup("TheJNDINameOfTheBeanOnRemoteServer");


          • 2. Re: local jboss  accessing EJB's deployed in remote jboss
            zhuhuapeng

            yes ,i tried it again by this way and it can runs well now .
            thank you.