2 Replies Latest reply on Jan 24, 2012 4:08 AM by prasad.deshpande

    Remoting JBOSS AS 7.1 CR1

    vithun.v

      I'm migrating my application from JBOSS 5.x to JBOSS 7.1. We are using the following code snippet to fetch a remote bean

       

      public static Object getRemoteBean(String beanName,String providerHost) throws NamingException{

       

           Properties p = new Properties();

           p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");

           p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");

           p.put(Context.PROVIDER_URL, providerHost+":1099"); // HA-JNDI port

           Context c = new InitialContext(p);

           return  c.lookup(beanName+"/remote");

       

      }

       

      The same doesn't seem to work with JBOSS 7.1 CR1. I came across a different approach in doing a lookup in the JBOSS AS 7 documentation,(click this link). In this approach the properties set seems to be different from that mentioned above.

       

      The URL also had this form

       

      ejb:<app-name>/<module-name>/<distinct-name>/<bean-name>!<fully-qualified-classname-of-the-remote-interface>

       

      My questions are

       

      1) What is the difference between these two approaches

      2) Does JBOSS 7.1 AS (CR1 beta) support the former (what we used in JBOSS 5 , i.e.,   c.lookup(beanName+"/remote"))

      3) If this is currently not supported, is it expected in the final release.

       

      Apart from the quetions above, i would be really thankful if refer me a good resource where i can throughly read more abour JBOSS remoting.

       

       

      Thnaks a ton!!!!!!!

        • 1. Re: Remoting JBOSS AS 7.1 CR1
          vithun.v

          My questions are

          1) What is the difference between these two approaches

          2) Does JBOSS 7.1 AS (CR1 beta) support the former (what we used in JBOSS 5 , i.e.,   c.lookup(beanName+"/remote"))

          3) If this is currently not supported, is it expected in the final release.

          Apart from the quetions above, i would be really thankful if refer me a good resource where i can throughly read more abour JBOSS remoting.

           

          Thnaks a ton!!!!!!!

          • 2. Re: Remoting JBOSS AS 7.1 CR1
            prasad.deshpande

            VITHUN VENGOPALAN wrote:

             

            My questions are

            1) What is the difference between these two approaches

            AS 7 & 7.1 supports EE6 standards of naming EJB's. However, these standards are used only on server side. On standalone remote client side EE6 doesn't say about any naming conventions. So

            ejb:<app-name>/<module-name>/<distinct-name>/<bean-name>!<fully-qualified-classname-of-the-remote-interface> is the convention used by AS7.1. Here https://community.jboss.org/message/637476#637476 is little explaination from Jason.

            2) Does JBOSS 7.1 AS (CR1 beta) support the former (what we used in JBOSS 5 , i.e.,   c.lookup(beanName+"/remote"))

             

            No, it doesn't as AS 7.1 supports EE6 naming standards for EJB's

             

            3) If this is currently not supported, is it expected in the final release.

            Apart from the quetions above, i would be really thankful if refer me a good resource where i can throughly read more abour JBOSS remoting.

             

            Thnaks a ton!!!!!!!

            No, it won't be supported in Final release as well. You can have a look around https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI, Also, have a look at this one. https://community.jboss.org/message/646352#646352