5 Replies Latest reply on Sep 6, 2012 10:22 AM by jaikiran pai

    EJBCLIENT000024: No EJB receiver available for handling

    Michael Gronau Newbie


      During some stress-testing our application, i get this exception, when we create multiple EJBClientContext Objects in different threads simultaniously (only in some of those threads):


      java.lang.IllegalStateException : EJBCLIENT000024: No EJB receiver available for handling [appName:jas-application, moduleName:core-ejb, distinctName:] combination

          at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:522)

          at org.jboss.ejb.client.EJBClient.createSession(EJBClient.java:161)

          at org.jboss.ejb.client.naming.ejb.EjbNamingContext.doCreateProxy(EjbNamingContext.java:135)

          at org.jboss.ejb.client.naming.ejb.EjbNamingContext.createEjbProxy(EjbNamingContext.java:113)

          ... 9 more


      In our case this exception occurs in at least 1 Thread when connecting and looking up a stateful bean with more than 10 Threads at the same time.


      Some debugging around this has shown that this exception is thrown because of a hard-coded timeout value in the class org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.associate(). The code line has a TODO:


          boolean successfulHandshake = false;
          try {
              // wait for the handshake to complete
              // TODO: Think about externalizing this timeout
              successfulHandshake = versionHandshakeLatch.await(5, TimeUnit.SECONDS);
              if (successfulHandshake) {
                  final Channel compatibleChannel = versionReceiver.getCompatibleChannel();
                  final ChannelAssociation channelAssociation = new ChannelAssociation(this, context, compatibleChannel, this.clientProtocolVersion, this.marshallerFactory, this.reconnectHandler);
                  synchronized (this.channelAssociations) {
                      this.channelAssociations.put(context, channelAssociation);
                  Logs.REMOTING.successfulVersionHandshake(context, compatibleChannel);
              } else {
                  // no version handshake done. close the context
          } catch (InterruptedException e) {


      When stressing the remote ejb client enough the client EJBClientContext is closed silently (because version handshake was not done within 5 seconds) and so no ejb receivers are available.

      I think, to make the timeout configurable would be a perfect solution for us.

      Should I create an Issue in JIRA?


      With best regards,