1 Reply Latest reply on Oct 10, 2013 4:25 PM by Wolf-Dieter Fink

    How to determine wether the Server is not available or the credentials are wrong when trying to connect to JBoss

    Michael Seeberger Newbie



      i got quite a simple Question. How can i can decide for what reason a connection to JBoss failed?

      The thrown Exception is always the same:


      Caused by: java.lang.IllegalStateException: No EJB receiver available for handling [appName:test,modulename:test-server-,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@3ea65611


      no matter if the server just ain't running or i'm passing the wrong credentials.

      If the server isn't running there is a warning in the log:


      WARN  [org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector] Could not register a EJB receiver for connection to remote://localhost:1099

      java.lang.RuntimeException: Operation failed with status WAITING

          at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:93)


      if the passed credentials are wrong there is this exception:


      DEBUG [org.jboss.ejb.client.remoting.MaxAttemptsReconnectHandler] Re-connect attempt# 1 failed for connection URI remote://localhost:1099

      java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed


      but as the comment in ConfigBasedEJBClientContextSelector.setupEJBReceivers() says the Exception just gets logged and won't be rethrown


      } catch (Exception e) {

                      // just log the warn but don't throw an exception. Move onto the next connection configuration (if any)

                      logger.warn("Could not register a EJB receiver for connection to remote://" + host + ":" + port, e);

                      // add a reconnect handler for this connection

                      if (reconnectHandler != null) {


                          logger.debug("Registered a reconnect handler in EJB client context " + this.ejbClientContext + " for remote://" + host + ":" + port);





      So how can i decide for what reason a connection failed.

      i think the solution is pretty simple but i just can't figure it out.