3 Replies Latest reply on Sep 3, 2010 4:42 AM by suter

    Make a call to an EJB3 this on a machine with weblogic through JNDI

    suter

      Hello  everyone.

       

      I'm still working with jboss and  thanks to your help I could do my job perfectly.

       

      In this instance, a new complication has arisen. We expose it below:
      I have two  machines, one with jboss and another with Weblogic 10.3. The fact is that most applications will be executed through  weblogic JBoss while for technical reasons it is responsible for  implementing EJB3 session. The idea is through the  remote JNDI call these sessions from JBoss to Weblogic.

       

      My first implementation has been to add the charge to seek  properties in the jndi tree as follows:
      propertie.put  (InitialContext.INITIAL_CONTEXT_FACTORY,  "weblogic.jndi.WLInitialContextFactory");
      propertie.put (InitialContext.PROVIDER_URL, "t3: / /  192.168.147.98:7001");

       

      The case is not  working and do not know if I have to configure some file in jboss or  weblogic.

       

      I would appreciate any  contribution that you can do about it.

       

      A greeting and thanks in advance.

        • 1. Re: Make a call to an EJB3 this on a machine with weblogic through JNDI
          jaikiran

          If I understand right, you are tyring to lookup an EJB which is deployed in JBoss, from Weblogic. If so, then you have to pass the INITIAL_CONTEXT_FACTORY (org.jnp.interfaces.NamingContextFactory) and PROVIDER_URL (jnp://IP:1099 where IP is the IP/hostname of JBoss server and 1099 should be replaced by the JBoss Naming port) corresponding to the JBoss AS server. Also you will have to place the appropriate JBoss specific client jar files (available in JBOSS_HOME/client folder) under Weblogic classpath.

          • 2. Re: Make a call to an EJB3 this on a machine with weblogic through JNDI
            suter

            Sorry, I  have not explained well. I will try to do better.

             

            1. I have two machines (one machine with jboss and another machine with weblogic).
            2. the applications are launched in jboss.
            3. In weblogic going to have the  EJB3 session.
            4. Jboss  applications must call the sessions through jndi remote.

             

            I hope I  have been more precise with my English.

            Thank you.

            • 3. Re: Make a call to an EJB3 this on a machine with weblogic through JNDI
              suter

              The solution is the next:

               

              Properties properties = new Properties();
                          properties.put( javax.naming.Context.PROVIDER_URL, "T3://IP:PORT/" );
                          properties.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );
                     
                          context = new InitialContext( properties );
                          Object initialReference = context.lookup(key_jndi);
                          objValue = (Object)javax.rmi.PortableRemoteObject.narrow(initialReference, Object.class );
                          return objValue;

               

              Thanks for all.