7 Replies Latest reply on Dec 3, 2014 7:31 AM by VITHUN VENGOPALAN

    Not able to make distributed stateless session bean calls.


      I run a wildfly environment with a modified standalone-ha cofiguration. I use a Singleton Service to decide the master (Is this the recommended practice?). This master would want to call ejb method remotely on other nodes (from a service kind of thread). I face a problem that, though I expect a remote call here, calls always happen in the local node and doesn't get to other nodes.


      I tried to attach wildfly and jboss-ejb-client-2.0.1.Final.jart source to debug the issue and noticed that the following field has only the local EJB receiver always even if I have multiple HA standalone servers active.


      public final class org.jboss.ejb.client.EJBClientContext{


           private final Map<EJBReceiver, ReceiverAssociation> ejbReceiverAssociations = new IdentityHashMap<EJBReceiver, ReceiverAssociation>();




      Note: On JGroups (and Infinispan), the nodes are aware of each other.


      Could you please point me to the configration areas that I have to look at to troubleshoot this issue. (And excuse me if I have done something stupid).


      PS:I use wildfly 8.1

        • 1. Re: Not able to make distributed stateless session bean calls.
          Paul Ferraro Master

          Have you followed the documentation here?

          EJB invocations from a remote server instance - WildFly 8 - Project Documentation Editor

          EJB Services - WildFly 8 - Project Documentation Editor


          On the "EJB services" page, ignore the "Marking an EJB as clustered" section - this is obsolete (I'll fix that).  EJBs are always "clusterable", unless otherwise specified, if deployed within the context of a server started with an ha-capable profile.

          • 2. Re: Not able to make distributed stateless session bean calls.
            VITHUN VENGOPALAN Newbie

            Thanks Paul, I assume the configuration based remoting limits the execution to the set of servers configured as Outbound . Could I configure remoting to all my mutlicast group in a distributed sense, or should I add the server enteries using API.

            • 3. Re: Re: Not able to make distributed stateless session bean calls.
              VITHUN VENGOPALAN Newbie



              Quoting from reference


              To create an enterprise bean that allows remote access, you must either


                  Decorate the business interface of the enterprise bean with the @Remote annotation:


                  @Remote public interface InterfaceName { ... }


                  Or decorate the bean class with @Remote, specifying the business interface or interfaces:


                  @Remote(InterfaceName.class) public class BeanName implements InterfaceName { ... }


              I think I faced issues with clustering when I go for the first approach..

              • 4. Re: Not able to make distributed stateless session bean calls.
                Paul Ferraro Master

                We have tests that validate that this works - so there must be some misconfiguration on your end.  Can you post the problematic code?

                • 5. Re: Not able to make distributed stateless session bean calls.
                  VITHUN VENGOPALAN Newbie

                  Sorry Paul, I by mistake infered that way.


                  However I am still facing this issue, not sure why this happens..


                  I have two nodes and I'm Posting my config file below, both the nodes have the same configuration file..



                  <?xml version='1.0' encoding='UTF-8'?>


                  <server xmlns="urn:jboss:domain:2.1">


                          <extension module="org.jboss.as.clustering.infinispan"/>

                          <extension module="org.jboss.as.clustering.jgroups"/>

                          <extension module="org.jboss.as.connector"/>

                          <extension module="org.jboss.as.deployment-scanner"/>

                          <extension module="org.jboss.as.ee"/>

                          <extension module="org.jboss.as.ejb3"/>

                          <extension module="org.jboss.as.jacorb"/>

                          <extension module="org.jboss.as.jaxrs"/>

                          <extension module="org.jboss.as.jdr"/>

                          <extension module="org.jboss.as.jmx"/>

                          <extension module="org.jboss.as.jpa"/>

                          <extension module="org.jboss.as.jsf"/>

                          <extension module="org.jboss.as.jsr77"/>

                          <extension module="org.jboss.as.logging"/>

                          <extension module="org.jboss.as.mail"/>

                          <extension module="org.jboss.as.messaging"/>

                          <extension module="org.jboss.as.modcluster"/>

                          <extension module="org.jboss.as.naming"/>

                          <extension module="org.jboss.as.pojo"/>

                          <extension module="org.jboss.as.remoting"/>

                          <extension module="org.jboss.as.sar"/>

                          <extension module="org.jboss.as.security"/>

                          <extension module="org.jboss.as.transactions"/>

                          <extension module="org.jboss.as.webservices"/>

                          <extension module="org.jboss.as.weld"/>

                          <extension module="org.wildfly.extension.batch"/>

                          <extension module="org.wildfly.extension.io"/>

                          <extension module="org.wildfly.extension.undertow"/>




                            <security-realm name="ejb-security-realm">


                                      <secret value="dGVzdA=="/>





                            <subsystem xmlns="urn:jboss:domain:ejb3:2.0">


                              <remote connector-ref="http-remoting-connector" thread-pool-name="default"/>




                         <subsystem xmlns="urn:jboss:domain:remoting:2.0">

                              <endpoint worker="default"/>

                              <http-connector name="http-remoting-connector" connector-ref="default"/>


                                  <remote-outbound-connection name="remote-ejb-connection" outbound-socket-binding-ref="remote-ejb" protocol="http-remoting" security-realm="ejb-security-realm" username="ejb">


                                          <property name="SASL_POLICY_NOANONYMOUS" value="false"/>

                                          <property name="SSL_ENABLED" value="false"/>






                      <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">


                          <outbound-socket-binding name="remote-ejb">

                              <remote-destination host="localhost" port="8080"/>







                  My jboss-ejb-client file


                  <jboss-ejb-client xmlns="urn:jboss:ejb-client:1.2">

                      <client-context deployment-node-selector="com.vithun.test.DepNodeSeletorX"> <!--every time I get only single node in the callback even if I have two nodes in the cluster -->


                              <remoting-ejb-receiver outbound-connection-ref="remote-ejb-connection"/>



                  <!-- cluster of remote-ejb-connection-1 -->

                  <cluster name="ejb" security-realm="ejb-security-realm" username="admin">


                  <property name="org.xnio.Options.SSL_ENABLED" value="false" />

                  <property name="org.xnio.Options.SASL_POLICY_NOANONYMOUS" value="false" />








                  However, I notice that when I give the IP of each other node in remote-ejb host, I get the calls distributed sometimes and sometime it gets distribued only on a single node.



                          <outbound-socket-binding name="remote-ejb">

                              <remote-destination host="!!IP OF OTHER NODE!!!" port="8080"/>




                  Expectation is that, I should get the calls distributed automatically without explicitly specifying every other IP.



                  PS: How do I transfer the caller principal to a remote call ( the one obtained from FORM login). I always get annonymous at the other end.

                  • 6. Re: Not able to make distributed stateless session bean calls.
                    VITHUN VENGOPALAN Newbie

                    Please confirm my assumption.


                    1) When I give the following outbound config, my server will be looped back as the remote receiver. This initially gets connected during server startup,.

                            <outbound-socket-binding name="remote-ejb">

                                <remote-destination host="localhost" port="8080"/>


                    2) The looped back remote receiver communicates cluster toplolgy information to my EJB Client (on the same machine).


                    The real problem I face is that the topology is not getting commuicated to my client.

                    • 7. Re: Not able to make distributed stateless session bean calls.
                      VITHUN VENGOPALAN Newbie

                      Thanks Paul for the help. I was able to manage it to get working


                      What are went wrong in my config


                      1) Initially my issue was that, since http connector was used, the server was bound to port x.x.x.x and not For this reason, the following didn't work

                          <outbound-socket-binding name="remote-ejb">

                                  <remote-destination host="localhost" port="8080"/>


                      2) I then bound http to, but then org.jboss.ejb.client.remoting,ClientMapping was recognizing the other target (destinationAddress) as and didn't work as expected.

                      3) When I try giving my own IP i.e, X.X.X.X for remote ejb, a local receiver gets registered.

                          <outbound-socket-binding name="remote-ejb">

                                  <remote-destination host="X.X.X.X" port="8080"/>


                      Local EJB receiver didn't update me about the clsuter toplogy for some reason.

                      4) Now when I disable local EJB receiver, things work.

                      <ejb-receivers exclude-local-receiver="true">


                      I understand the LocalEJBReceiver itself should have worked. I'm checking whats wrong in my congig that makes it go wrong. Meanwhile, please let me know if there is a known limitation.