4 Replies Latest reply on Feb 25, 2012 6:47 AM by mcostagonzalez

    Trouble with remote EJB invocation from one server to another

    mcostagonzalez

      Good day all

       

      I'm trying to call a remote ejb deployed in a Jboss AS7.1 from another one with a simple web application with no success at all. I've followed the steps in the doc https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+server+instance, but it doesn't work at all.

       

      I can see the file 'jboss-ejb-client.xml' is read by the container, when the Jboss with the EJB is not running, the deployment crushes; if I stop the webapp container, the other one complains about it, so it seems they are communicating.

       

      The exception is as follows:

       

      19:32:08,066 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/prueba].[default]] (http--127.0.0.1-8080-1) Servlet.service() para servlet default lanzó excepción: java.lang.RuntimeException: java.lang.IllegalArgumentException: Could not find module app: pruebaEJBEar module: pruebaEJBJar distinct name:

                at com.prueba.bean.TestBean.invokeOnBean(TestBean.java:50) [classes:]

                at com.prueba.filter.TestFilter.doFilter(TestFilter.java:17) [classes:]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.10.Final.jar:]

                at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154) [jboss-as-web-7.1.0.Final.jar:7.1.0.Final]

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.10.Final.jar:]

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.10.Final.jar:]

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.10.Final.jar:]

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.10.Final.jar:]

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.10.Final.jar:]

                at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_16]

      Caused by: java.lang.IllegalArgumentException: Could not find module app: pruebaEJBEar module: pruebaEJBJar distinct name:

                at org.jboss.as.ejb3.remote.LocalEjbReceiver.findBean(LocalEjbReceiver.java:274) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation(LocalEjbReceiver.java:109) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:173) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:43) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:175) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:92) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:175) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104) [jboss-ejb-client-1.0.2.Final.jar:1.0.2.Final]

                at $Proxy13.greet(Unknown Source)          at com.prueba.bean.TestBean.invokeOnBean(TestBean.java:45) [classes:]

                ... 14 more

       

      As I stated before, my configuration is exactly the one from the sample. I'm running Windows 7 64bit in my computer, firewalls are deactivated. If I configure a single Jboss to target himself for remoting (port 4447), the sample works perfectly, the problem is when I try with two different containers.

       

      I'd appreciate if someone can help .

        • 1. Re: Trouble with remote EJB invocation from one server to another
          markus78

          If you are running both servers on localhost try setting the -Djboss.node.name on at least one of the servers, I'm not sure if it matters for host-host invocations though but give it a try.

          • 2. Re: Trouble with remote EJB invocation from one server to another
            mcostagonzalez

            Thanks for the answer, I just tried but it didn't work sadly .

             

            Any other ideas?

            • 3. Re: Trouble with remote EJB invocation from one server to another
              markus78

              Alright, are you certain that the 'jboss-ejb-client.xml' is in your ear meta-inf folder on the client? I belive the communication between the servers will happen anyways since you specify an outbound connector on the client, also can you post your standalone.xml? or the relevant parts atleast.

              • 4. Re: Trouble with remote EJB invocation from one server to another
                mcostagonzalez

                I think there will be no need to post any files. It works now .

                 

                In the end, the key was in the -Djboss.node.name parameter, as you said before; I don't know why it didn't work when I posted before.

                 

                When you put a node name in both servers, the client shows this lines when booting:

                 

                12:38:49,145 INFO  [org.jboss.ejb.client.remoting.VersionReceiver] (Remoting "Client" task-4) Received server version 1 and marshalling strategies [river]

                12:38:49,160 INFO  [org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver] (MSC service thread 1-4) Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@181f93f8, receiver=Remoting connection EJB receiver [connection=Remoting connection <4e28f1d6>,channel=jboss.ejb,nodename=EJB]} on channel Channel ID e704175e (outbound) of Remoting connection 713a4e73 to 127.0.0.1/127.0.0.1:5447

                12:38:49,192 WARN  [org.jboss.ejb.client.remoting.ChannelAssociation] (Remoting "Client" task-1) Unsupported message received with header 0xffffffff

                 

                These don't show up without the parameter.

                 

                Thank you markus78. I hope this post helps anyone that also have this problem.

                 

                I think this is a very important point and should be added to the sample in https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+server+instance.

                1 of 1 people found this helpful