JBoss Community

EJBCLIENT000024: No EJB receiver available for handling

created by Michael Gronau in JBoss AS 7 Development - View the full discussion

Hi,

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
            Logs.REMOTING.versionHandshakeNotCompleted(context);
            context.close();
        }
    } catch (InterruptedException e) {
        context.close();
    }

 

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,

Michael

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community