1 Reply Latest reply on Feb 17, 2012 6:06 PM by xinziwu

    How to invoke an EJB deployed on JBoss 5.1 from a JBoss 7.1 client?

    xinziwu

      I'm currently running a web-based application using JBoss 7.1.0 beta 1b. I need to invoke an EJB hosted on a remote JBoss 5.1 server. Back in the JBoss 5 time, I would use the following code to look up the EJB:

       

      Properties properties = new Properties();

      properties.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");

      properties.put("java.naming.provider.url","jnp://remotehost:1099");

      properties.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");

      InitialContext ctx = new InitialContext(properties);

      String jndiName = "MyEJBService";   

      myEjb = ctx.lookup(jndiName);

       

      However, the above code does not work for JBoss 7.1. I'm aware of the EJB remote client changes introduced in JBoss 7.1 and have read the article https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI. However, in my case, the actual EJB is still hosted on JBoss 5.1. It's the remote EJB client that lives on JBoss 7.1. Is it even possible to have a JBoss 7.1 remote EJB client to invoke an EJB hosted on JBoss 5.1? Any insights/directions are greatly appreciated!