0 Replies Latest reply on Mar 18, 2015 5:03 PM by kts92tln8

    calling remote ejb from web application in same domain

    kts92tln8

      on JBoss EAP 6.2 with domain config

       

      I have 2 server groups in one domain:

      •   server-group-one: has 2 servers
        • oneA on one.host.com with remoting port 4447
        • oneB on two.host.com with remoting port 4447
      •   server-group-two has 2 servers
        • twoA on one.host.com
        • twoB on two.host.com

       

      server-group-one has a Webservice deployed on it, OneWebService

      server-group-two has a EJB deployed on it, TwoEJB

       

      OneWebService wants to call TwoEJB

       

      we are not (and dont want to) use annotations, what I did is following--

       

        in OneWebService code:

       

        Hashtable env = new Hashtable();

        env.put(Context.PROVIDER_URL, "remote://one.host.com:4447,remote://two.host.com:4447");

        Context jndicntx = new InitialContext(env);

        Object obj = jndicntx.lookup("java:global/TwoEJB/TwoEJBBean!com.foo.bar.TwoEJBRemote");

       

      and lookup fails with following exception

       

        javax.naming.NameNotFoundException: TwoEJB/TwoEJBBean!com.foo.bar.TwoEJBRemote -- service jboss.naming.context.java.global.TwoEJB."TwoEJBBean!com.foo.bar.TwoEJBRemote"

        at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:103)

        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:197)

        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:174)

        at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:122)

        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:183)

        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)

        at javax.naming.InitialContext.lookup(InitialContext.java:411)

       

      to test this I invoke OneWebService using http url from a standalone java client, and OneWebService suppose to do the EJB call to TwoEJB

       

      I could invoke this ejb from a standalone java client.

       

      any suggestions/examples/pointers are appreciated

       

      Thanks

        DS