Troubleshooting remote EJB client Exceptions in JBoss EAP 7.1+

Solution Verified - Updated

Environment

  • Red Hat Enterprise Application Platform (EAP)
    • 7.2
    • 7.1

Issue

  • Troubleshooting remote EJB client Exceptions in JBoss EAP 7.1
  • Troubleshooting remote EJB client Exceptions in JBoss EAP 7.2

Resolution

EJBCLIENT000409 ... NoSuchEJBException

This indicates the client created an InitialContext pointing to a JBoss EAP server and tried to look up an EJB, but the EJB was not deployed on the server contacted. Note the path shown in the NoSuchEJBException does not include the interface at the end, just the lookup path up to the EJB name.

     Exception in thread "main" org.jboss.ejb.client.RequestSendFailedException: EJBCLIENT000409: No more destinations are available
      	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:567)
      	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:503)
...
      	Suppressed: javax.ejb.NoSuchEJBException: No such EJB: /ejb-client/HelloBean @ remote+http://localhost:8080
      		at org.jboss.ejb.protocol.remote.EJBClientChannel$MethodInvocation.handleResponse(EJBClientChannel.java:1075)
      		at org.jboss.ejb.protocol.remote.EJBClientChannel$MethodInvocation.handleResponse(EJBClientChannel.java:1002)

CommunicationException ... ClassNotFoundException

This indicates the client application is doing initialContext.lookup("ejb:/app/module/EJB!interface") and the interface is not correct or not in the classpath for the client application.

Exception in thread "main" javax.naming.CommunicationException: EJBCLIENT000062: Failed to look up "/ejb-client/Hello!com.jboss.examples.ejb.HelloWrong" [Root exception is java.lang.ClassNotFoundException: com.jboss.examples.ejb.Hell]
...
      Caused by: java.lang.ClassNotFoundException: com.jboss.examples.ejb.HelloWrong
...

NameNotFoundException

This indicates the client application tried to lookup an EJB that is not at the JNDI location supplied.

In this example, the JNDI location ejb-client/Hello!com.jboss.examples.ejb.Hello2 is incorrect or the EJB is not deployed in the remote server that is specified in the JNDI environment properties.

Context ctx = new InitialContext(environment);
Hello ejbProxy = (Hell) ctx.lookup("ejb-client/Hello!com.jboss.examples.ejb.Hello2")

Example exception stacktrace:

javax.naming.NameNotFoundException: ejb-client/Hello!com.jboss.examples.ejb.Hello2 -- service jboss.naming.context.java.jboss.exported.ejb-client."Hello!com.jboss.examples.ejb.Hello2"
 	at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:106)
     …

ExhaustedDestinationsException

This exception indicates that it was unable to connect to the remote server. The Suppressed stacktrace will indicate the different causes.

ExhaustedDestinationsException - CommunicationException - ConnectException

The ConnectException indicates that the client is unable to connect to the host/port specified, which could be caused by:

  • The server is not running
  • The server is not configured to listen on the port the client is trying to connect to
  • The server is not listening on the IP / host that the client is trying to connect to
  • A firewall or other is in between the client and server and is not allowing traffic on the specified port

Example exception stacktrace:

org.wildfly.naming.client.ExhaustedDestinationsException: WFNAM00055: No more destinations are available to attempt the operation (2 blacklisted, 0 transiently failed). See suppressed exceptions for details
 	at org.wildfly.naming.client.NamingProvider.getPeerIdentityForNamingUsingRetry(NamingProvider.java:94)
     …
 	at javax.naming.InitialContext.lookup(InitialContext.java:417)
 	Suppressed: javax.naming.CommunicationException: WFNAM00018: Failed to connect to remote host [Root exception is java.net.ConnectException: Operation timed out]
 		at ...use of destination...(http-remoting://localhost2:8080)
     …
 	Caused by: java.net.ConnectException: Operation timed out
     …
 	Suppressed: javax.naming.CommunicationException: WFNAM00018: Failed to connect to remote host [Root exception is java.net.ConnectException: Connection refused]
 		at ...use of destination...(http-remoting://localhost:8180)
 		at org.wildfly.naming.client.remote.RemoteNamingProvider.getPeerIdentityForNaming(RemoteNamingProvider.java:110)
     …
 	Caused by: java.net.ConnectException: Connection refused
     …

ExhaustedDestinationsException - CommunicationException - SaslException

The SaslException indicates that the client is unable to authenticate to the host/port specified, which could be caused by:

  • The client is specifying the wrong username / password in the JNDI environment properties
  • The server specified may be the wrong server for the given username / password

Example exception stacktrace:

org.wildfly.naming.client.ExhaustedDestinationsException: WFNAM00055: No more destinations are available to attempt the operation (2 blacklisted, 0 transiently failed). See suppressed exceptions for details
 	at org.wildfly.naming.client.NamingProvider.getPeerIdentityForNamingUsingRetry(NamingProvider.java:94)
     …
 	at javax.naming.InitialContext.lookup(InitialContext.java:417)
 	Suppressed: javax.naming.CommunicationException: WFNAM00018: Failed to connect to remote host [Root exception is java.net.ConnectException: Connection refused]
 		at ...use of destination...(http-remoting://localhost:8180)
     …
 	Caused by: java.net.ConnectException: Connection refused
     …
 	Suppressed: javax.naming.CommunicationException: WFNAM00018: Failed to connect to remote host [Root exception is javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed:
    DIGEST-MD5: javax.security.sasl.SaslException: DIGEST-MD5: Server rejected authentication]
 		at ...use of destination...(http-remoting://localhost:8080)
     …
 	Caused by: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed:
    DIGEST-MD5: javax.security.sasl.SaslException: DIGEST-MD5: Server rejected authentication
     …
 		Suppressed: javax.security.sasl.SaslException: DIGEST-MD5: Server rejected authentication
     …

WFTXN0045: Failed to receive a response from peer / ChannelClosedException: Channel was closed

  • The client side did not receive a response to the heartbeat ping and the connection was closed

Example stacktrace:

javax.transaction.SystemException: WFTXN0045: Failed to receive a response from peer
	at org.wildfly.transaction.client.provider.remoting.RemotingRemoteTransactionHandle.rollback(RemotingRemoteTransactionHandle.java:229)
	at org.wildfly.transaction.client.RemoteTransaction$Located.rollback(RemoteTransaction.java:361)
	at org.wildfly.transaction.client.RemoteTransaction.rollback(RemoteTransaction.java:129)
	at org.wildfly.transaction.client.RemoteTransaction.rollbackAndDissociate(RemoteTransaction.java:134)
	at org.wildfly.transaction.client.ContextTransactionManager.rollback(ContextTransactionManager.java:83)
	at org.wildfly.transaction.client.RemoteUserTransaction.rollback(RemoteUserTransaction.java:76)
...
Caused by: org.jboss.remoting3.ChannelClosedException: Channel was closed
	at org.jboss.remoting3.util.BlockingInvocation$Response.getInputStream(BlockingInvocation.java:136)
	at org.wildfly.transaction.client.provider.remoting.RemotingRemoteTransactionHandle.rollback(RemotingRemoteTransactionHandle.java:197)
	... 7 more

EJBCLIENT000409 ... ConnectException: Connection refused

This means the client did new InitialContext supplying a provider URL, but the host/port in the provider URL was not running or could not be reached and it failed with a connection refused.

Exception in thread "main" org.jboss.ejb.client.RequestSendFailedException: EJBCLIENT000409: No more destinations are available
...
Suppressed: org.jboss.ejb.client.RequestSendFailedException
...
Caused by: java.net.ConnectException: Connection refused

EJBCLIENT000066: Operation interrupted in JBoss EAP 7.1

EJBCLIENT000082: Cannot outflow the remote transaction "Remote transaction

See EJBCLIENT000082: Cannot outflow the remote transaction "Remote transaction

Related Solutions

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.