Diagnosing EJB Exceptions on JBoss EAP 6
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Issue
- EJB Exceptions on JBoss EAP 6
Resolution
Do we have EJB logging that shows when an EJB gets called and/or is returning to the client?
Client Side
EJBCLIENT000025: No EJB receiver available for handling
This EJBCLIENT000025 exception is thrown on the client side, when a client application tries to invoke a remote EJB running on another JBoss instance and there is no connection to another JBoss instance with the requested EJB. This means that the client side either has not configured any remote JBoss instances or has incorrect configuration such as for the host, port, username, password, etc...
If client is using ejb-client
Then check that there is a jboss-ejb-client.xml in the application if running in JBoss EAP 6 and that it has remote ejb receivers defined in the client JBoss instance profile xml. If the client is a standalone java application, then check the jboss-ejb-client.properties or programatic configuration to ensure the settings are correct.
If client is using ejb-client scoped context
Then ensure that the InitialContext object is not being closed or garbage collected, as this will close the remote connection and any ejb calls made on the proxy will fail with EJBCLIENT000025
If client is using ejb-client via remote-naming remote:
Then ensure that the InitialContext object is not being closed or garbage collected, as this will close the remote connection and any ejb calls made on the proxy will fail with EJBCLIENT000025
[1] https://access.redhat.com/solutions/396853
Client side:
This Exception means the client could not get access to an EJB instance with in the given instance timeout - <https://access.redhat.com/site/solutions/255033>
12:58:58,633 ERROR [org.jboss.as.ejb3.invocation] (http-/127.0.0.1:8080-2) JBAS014134: EJB Invocation failed on component HelloBean for method public abstract java.lang.String com.jboss.examples.ejb3.Hello.hello(java.lang.Long): javax.ejb.EJBException: JBAS014516: Failed to acquire a permit within 1 MINUTES
at org.jboss.as.ejb3.pool.strictmax.StrictMaxPool.get(StrictMaxPool.java:109) [jboss-as-ejb3-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:47) [jboss-as-ejb3-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
...
12:58:58,659 WARNING [javax.enterprise.resource.webcontainer.jsf.lifecycle] (http-/127.0.0.1:8080-2) #{bean.helloSleep}: javax.ejb.EJBException: JBAS014516: Failed to acquire a permit within 1 MINUTES: javax.faces.FacesException: #{bean.helloSleep}: javax.ejb.EJBException: JBAS014516: Failed to acquire a permit within 1 MINUTES
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:117) [jsf-impl-2.1.19-redhat-1.jar:2.1.19-redhat-1]
at javax.faces.component.UICommand.broadcast(UICommand.java:315) [jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
...
Caused by: javax.ejb.EJBException: JBAS014516: Failed to acquire a permit within 1 MINUTES
at org.jboss.as.ejb3.pool.strictmax.StrictMaxPool.get(StrictMaxPool.java:109) [jboss-as-ejb3-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:47) [jboss-as-ejb3-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
...
Invocation timeouts - <https://access.redhat.com/site/solutions/147333>
Example where EJB client calls EJB, that EJB sleeps for 30 seconds, the EJB client is set to 10 sec invocation.timeout and it fails because the EJB does not return before then.
Client side:
[java] Exception in thread "main" javax.ejb.EJBException: java.util.concurrent.TimeoutException: No invocation response received in 10000 milliseconds
[java] at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:236)
[java] at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)
[java] at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
[java] at $Proxy0.sayHello(Unknown Source)
[java] at jboss.example.ejb.HelloClient.testEJBProtocol(HelloClient.java:67)
[java] at jboss.example.ejb.HelloClient.main(HelloClient.java:29)
[java] Caused by: java.util.concurrent.TimeoutException: No invocation response received in 10000 milliseconds
[java] at org.jboss.ejb.client.EJBClientInvocationContext$InvocationTimeoutResultProducer.getResult(EJBClientInvocationContext.java:698)
[java] at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:272)
[java] at org.jboss.ejb.client.EJBObjectInterceptor.handleInvocationResult(EJBObjectInterceptor.java:64)
[java] at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:274)
[java] at org.jboss.ejb.client.EJBHomeInterceptor.handleInvocationResult(EJBHomeInterceptor.java:88)
[java] at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:274)
[java] at org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:46)
[java] at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:274)
[java] at org.jboss.ejb.client.ReceiverInterceptor.handleInvocationResult(ReceiverInterceptor.java:129)
[java] at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:262)
[java] at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:437)
[java] at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:202)
[java] ... 5 more
Client Side Standalone
Authentication failed
The ERROR/WARN below indicates that the client was able to talk to connec to the remote server mentioned (127.0.0.1:4447 in the example below), but unable to authenticate such as the client was configured with the wrong username/password. So the client's configuration would need to be corrected or possibly the client's credentials needs to be added to the server side via add-user.sh
ERROR [org.jboss.remoting.remote.connection] JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
WARN [org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector] Could not register a EJB receiver for connection to 127.0.0.1:4447: java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:91) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:77) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.remoting.RemotingConnectionManager.getConnection(RemotingConnectionManager.java:51) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:146) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:115) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:47) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.EJBClientContext.getCurrent(EJBClientContext.java:271) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:281) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:176) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at $Proxy0.create(Unknown Source) at com.jboss.examples.client.Client.main(Client.java:25) [:]
Caused by: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:344) [jboss-remoting-3.2.16.GA-redhat-1.jar:3.2.16.GA-redhat-1]
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:227) [jboss-remoting-3.2.16.GA-redhat-1.jar:3.2.16.GA-redhat-1]
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72) [xnio-api-3.0.7.GA-redhat-1.jar:3.0.7.GA-redhat-1]
at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189) [xnio-api-3.0.7.GA-redhat-1.jar:3.0.7.GA-redhat-1]
at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103) [xnio-api-3.0.7.GA-redhat-1.jar:3.0.7.GA-redhat-1]
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72) [xnio-api-3.0.7.GA-redhat-1.jar:3.0.7.GA-redhat-1]
at org.xnio.nio.NioHandle.run(NioHandle.java:90) [xnio-nio-3.0.7.GA-redhat-1.jar:3.0.7.GA-redhat-1]
at org.xnio.nio.WorkerThread.run(WorkerThread.java:187) [xnio-nio-3.0.7.GA-redhat-1.jar:3.0.7.GA-redhat-1]
at ...asynchronous invocation...(Unknown Source)
at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:270) [jboss-remoting-3.2.16.GA-redhat-1.jar:3.2.16.GA-redhat-1]
at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:386) [jboss-remoting-3.2.16.GA-redhat-1.jar:3.2.16.GA-redhat-1]
at org.jboss.ejb.client.remoting.EndpointPool$PooledEndpoint.connect(EndpointPool.java:182) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:151) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:132) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:75) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
... 10 more
12:30:58,686 ERROR [org.jboss.remoting.remote.connection] JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:helloWorld, moduleName:helloWorld-ejb, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@4fa4ded3
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:729)
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116)
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)
at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:253)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
at $Proxy0.create(Unknown Source)
at com.jboss.examples.client.Client.main(Client.java:25)
Connection failed
This warning below means the client timed out waiting trying to connect to the server mentioned below (127.0.0.1:4447 in the example below):
12:33:58,214 WARN [org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector] Could not register a EJB receiver for connection to 127.0.0.1:4447: java.lang.RuntimeException: Operation failed with status WAITING
at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:93) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:77) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.remoting.RemotingConnectionManager.getConnection(RemotingConnectionManager.java:51) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:146) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:115) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:47) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.EJBClientContext.getCurrent(EJBClientContext.java:271) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:281) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:176) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144) [jboss-ejb-client-1.0.23.Final-redhat-1.jar:1.0.23.Final-redhat-1]
at $Proxy0.create(Unknown Source) at com.jboss.examples.client.Client.main(Client.java:25) [:]
java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:helloWorld, moduleName:helloWorld-ejb, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@53cffeb4
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:729)
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116)
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)
at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:253)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
at $Proxy0.create(Unknown Source)
at com.jboss.examples.client.Client.main(Client.java:25)
Read timed out caused by firewall
If the firewall closes the connection, the client will get a 'Read timed out', then 'Writes have been shut down'. On the server side it will see a 'Writes closed' if it tries to send a message back to the client after it has failed.
org.xnio.channels.ReadTimeoutException: Read timed out
at org.xnio.nio.AbstractNioStreamChannel.read(AbstractNioStreamChannel.java:258)
at org.xnio.ssl.JsseConnectedSslStreamChannel.unwrap(JsseConnectedSslStreamChannel.java:442)
at org.xnio.ssl.JsseConnectedSslStreamChannel.read(JsseConnectedSslStreamChannel.java:487)
at org.xnio.ssl.JsseConnectedSslStreamChannel.read(JsseConnectedSslStreamChannel.java:452)
at org.xnio.channels.FramedMessageChannel.receive(FramedMessageChannel.java:90)
at org.jboss.remoting3.remote.RemoteReadListener.handleEvent(RemoteReadListener.java:75)
at org.jboss.remoting3.remote.RemoteReadListener.handleEvent(RemoteReadListener.java:45)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
at org.xnio.ssl.JsseConnectedSslStreamChannel.handleReadable(JsseConnectedSslStreamChannel.java:183)
at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
at org.xnio.nio.NioHandle.run(NioHandle.java:90)
at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:219)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:132)
...
java.io.EOFException: Writes have been shut down
at org.xnio.channels.FramedMessageChannel.send(FramedMessageChannel.java:225)
at org.jboss.remoting3.remote.RemoteConnection$RemoteWriteListener.send(RemoteConnection.java:312)
at org.jboss.remoting3.remote.RemoteConnection.send(RemoteConnection.java:122)
at org.jboss.remoting3.remote.RemoteConnectionChannel.closeReadsAndWrites(RemoteConnectionChannel.java:257)
at org.jboss.remoting3.remote.RemoteConnectionChannel.closeAction(RemoteConnectionChannel.java:530)
at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:359)
at org.jboss.remoting3.remote.RemoteConnectionHandler.closeAllChannels(RemoteConnectionHandler.java:392)
at org.jboss.remoting3.remote.RemoteConnectionHandler.handleConnectionClose(RemoteConnectionHandler.java:109)
at org.jboss.remoting3.remote.RemoteReadListener.handleEvent(RemoteReadListener.java:394)
at org.jboss.remoting3.remote.RemoteReadListener.handleEvent(RemoteReadListener.java:45)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
at org.xnio.ssl.JsseConnectedSslStreamChannel.handleReadable(JsseConnectedSslStreamChannel.java:183)
at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
at org.xnio.nio.NioHandle.run(NioHandle.java:90)
at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:219)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:132)
Server Side
Server side:
NotOpenException: Writes closed - server trying to send EJB response to client that disconnected
This means the EJB could not send the response back because the client has closed:
ERROR [org.jboss.as.ejb3] (EJB default - 1) JBAS014250: Could not write method invocation failure for method public abstract java.lang.String jboss.example.ejb.Hello.sayHello(int) on bean named Hello for appname modulename ejb-client distinctname due to: java.io.IOException: JBAS014560: Could not open message outputstream for writing to Channel
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.writeMethodInvocationResponse(MethodInvocationMessageHandler.java:362)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$600(MethodInvocationMessageHandler.java:70)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:246)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [rt.jar:1.6.0_30]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_30]
at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_30]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_30]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_30]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.0.Final-redhat-1.jar:2.1.0.Final-redhat-1]
Caused by: org.jboss.remoting3.NotOpenException: Writes closed
at org.jboss.remoting3.remote.RemoteConnectionChannel.openOutboundMessage(RemoteConnectionChannel.java:108) [jboss-remoting-3.2.16.GA-redhat-1.jar:3.2.16.GA-redhat-1]
at org.jboss.remoting3.remote.RemoteConnectionChannel.writeMessage(RemoteConnectionChannel.java:297) [jboss-remoting-3.2.16.GA-redhat-1.jar:3.2.16.GA-redhat-1]
at org.jboss.as.ejb3.remote.protocol.versionone.ChannelAssociation.acquireChannelMessageOutputStream(ChannelAssociation.java:68)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.writeMethodInvocationResponse(MethodInvocationMessageHandler.java:360)
... 9 more
Possible Causes:
- The client is using ejb-client scoped context or remote-naming, in which the connection to the server is tied to the InitialContext object and the InitialContext object was closed or garbage collected resulting in the connection being closed. The flow would be client opens a connection and calls the EJB. The EJB starts processing the request and while still processing the client closes the connection. The EJB finishes processing and goes to return the response, but the connection is closed, thus resutling in the
org.jboss.remoting3.NotOpenException: Writes closed.
NotOpenException: Writes closed - client using remote naming trying to send a message on a closed connection
ERROR [org.jboss.as.naming] (pool-23-thread-6) JBAS011809: Failed to send exception response to client: org.jboss.remoting3.NotOpenException: Writes closed
at org.jboss.remoting3.remote.RemoteConnectionChannel.openOutboundMessage(RemoteConnectionChannel.java:113)
at org.jboss.remoting3.remote.RemoteConnectionChannel.writeMessage(RemoteConnectionChannel.java:302)
at org.jboss.naming.remote.protocol.v1.WriteUtil.write(WriteUtil.java:59)
at org.jboss.naming.remote.protocol.v1.WriteUtil.writeExceptionResponse(WriteUtil.java:81)
at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.sendIOException(RemoteNamingServerV1.java:97)
at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:86)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
: org.jboss.remoting3.NotOpenException: Writes closed
at org.jboss.remoting3.remote.RemoteConnectionChannel.openOutboundMessage(RemoteConnectionChannel.java:113)
at org.jboss.remoting3.remote.RemoteConnectionChannel.writeMessage(RemoteConnectionChannel.java:302)
at org.jboss.naming.remote.protocol.v1.WriteUtil.write(WriteUtil.java:59)
at org.jboss.naming.remote.protocol.v1.WriteUtil.writeExceptionResponse(WriteUtil.java:81)
at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.sendIOException(RemoteNamingServerV1.java:97)
at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:86)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_76]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_76]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_76]
Possible Causes:
- Make sure the client has not closed the InitialContext
- Make sure the client holds a reference to the InitialContext object, otherwise if it goes out of scoped, the garbage collector can collect it and it will result in the connection being closed
- Make sure the InitialContext object is not being shared across threads, it is not thread safe
NotOpenException: Writes closed - server is trying to send version info back to the client for connection negotiation
ERROR [org.jboss.as.ejb3] (Remoting "host1" task-40) JBAS014140: Closing channel Channel ID 57473094 (inbound) of Remoting connection 5213bbc1 to /135.121.158.173:31561 due to an error: java.io.IOException: JBAS014560: Could not open message outputstream for writing to Channel
at org.jboss.as.ejb3.remote.EJBRemoteConnectorService.sendVersionMessage(EJBRemoteConnectorService.java:171)
at org.jboss.as.ejb3.remote.EJBRemoteConnectorService.access$000(EJBRemoteConnectorService.java:73)
at org.jboss.as.ejb3.remote.EJBRemoteConnectorService$ChannelOpenListener.channelOpened(EJBRemoteConnectorService.java:211)
at org.jboss.remoting3.spi.SpiUtils$ServiceOpenTask.run(SpiUtils.java:126)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.jboss.remoting3.NotOpenException: Writes closed
at org.jboss.remoting3.remote.RemoteConnectionChannel.openOutboundMessage(RemoteConnectionChannel.java:113)
at org.jboss.remoting3.remote.RemoteConnectionChannel.writeMessage(RemoteConnectionChannel.java:302)
at org.jboss.as.ejb3.remote.protocol.versionone.ChannelAssociation.acquireChannelMessageOutputStream(ChannelAssociation.java:68)
at org.jboss.as.ejb3.remote.EJBRemoteConnectorService.sendVersionMessage(EJBRemoteConnectorService.java:169)
... 6 more
: java.io.IOException: JBAS014560: Could not open message outputstream for writing to Channel
at org.jboss.as.ejb3.remote.EJBRemoteConnectorService.sendVersionMessage(EJBRemoteConnectorService.java:171)
at org.jboss.as.ejb3.remote.EJBRemoteConnectorService.access$000(EJBRemoteConnectorService.java:73)
at org.jboss.as.ejb3.remote.EJBRemoteConnectorService$ChannelOpenListener.channelOpened(EJBRemoteConnectorService.java:211)
at org.jboss.remoting3.spi.SpiUtils$ServiceOpenTask.run(SpiUtils.java:126)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_76]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_76]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_76]
Caused by: org.jboss.remoting3.NotOpenException: Writes closed
at org.jboss.remoting3.remote.RemoteConnectionChannel.openOutboundMessage(RemoteConnectionChannel.java:113)
at org.jboss.remoting3.remote.RemoteConnectionChannel.writeMessage(RemoteConnectionChannel.java:302)
at org.jboss.as.ejb3.remote.protocol.versionone.ChannelAssociation.acquireChannelMessageOutputStream(ChannelAssociation.java:68)
at org.jboss.as.ejb3.remote.EJBRemoteConnectorService.sendVersionMessage(EJBRemoteConnectorService.java:169)
... 6 more
It appears the client started a connection negotiation and the server is trying to send version info back to the client, but the client disconnected, and the server has no connection to send the message back to.
Possible Causes:
- The client is using ejb-client scoped context or remote-naming, in which the connection to the server is tied to the InitialContext object and the InitialContext object was closed or garbage collected resulting in the connection being closed. The flow would be client opens a connection and calls the EJB. The EJB starts processing the request and while still processing the client closes the connection. The EJB finishes processing and goes to return the response, but the connection is closed, thus resutling in the
org.jboss.remoting3.NotOpenException: Writes closed.
NotOpenException: Writes closed - when using remoting jmx connector
Server
ERROR [org.jboss.remotingjmx.protocol.v2.ServerCommon] (pool-21-thread-44) org.jboss.remoting3.NotOpenException: Writes closed
Possible Causes:
- Make sure the JMX Connector was not closed
- Make sure a reference is held to the JMX Connector, otherwise if it goes out of scope the garbage collector will collect it and result in the connection being closed
How to Access MBeanServerConnection from remote JMX Client in JBoss EAP 6
NotOpenException on server after client disconnects
WARN [org.jboss.as.ejb3] (Remoting "host1" task-9) JBAS014213: Could not send initial module availability report to channel Channel ID 7dddcd77 (inbound) of Remoting connection 38bd8c72 to /192.168.1.100:4447: java.io.IOException: JBAS014560: Could not open message outputstream for writing to Channel
at org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver.sendModuleAvailability(VersionOneProtocolChannelReceiver.java:247)
at org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver.listenerAdded(VersionOneProtocolChannelReceiver.java:212)
at org.jboss.as.ejb3.deployment.DeploymentRepository.addListener(DeploymentRepository.java:111)
at org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver.startReceiving(VersionOneProtocolChannelReceiver.java:98)
at org.jboss.as.ejb3.remote.EJBRemoteConnectorService$ClientVersionMessageReceiver.handleMessage(EJBRemoteConnectorService.java:288)
at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:455)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.jboss.remoting3.NotOpenException: Writes closed
at org.jboss.remoting3.remote.RemoteConnectionChannel.openOutboundMessage(RemoteConnectionChannel.java:114)
at org.jboss.remoting3.remote.RemoteConnectionChannel.writeMessage(RemoteConnectionChannel.java:305)
at org.jboss.as.ejb3.remote.protocol.versionone.ChannelAssociation.acquireChannelMessageOutputStream(ChannelAssociation.java:68)
at org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver.sendModuleAvailability(VersionOneProtocolChannelReceiver.java:245)
... 8 more
: java.io.IOException: JBAS014560: Could not open message outputstream for writing to Channel
at org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver.sendModuleAvailability(VersionOneProtocolChannelReceiver.java:247)
at org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver.listenerAdded(VersionOneProtocolChannelReceiver.java:212)
at org.jboss.as.ejb3.deployment.DeploymentRepository.addListener(DeploymentRepository.java:111)
at org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver.startReceiving(VersionOneProtocolChannelReceiver.java:98)
at org.jboss.as.ejb3.remote.EJBRemoteConnectorService$ClientVersionMessageReceiver.handleMessage(EJBRemoteConnectorService.java:288)
at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:455)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_76]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_76]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_76]
Caused by: org.jboss.remoting3.NotOpenException: Writes closed
at org.jboss.remoting3.remote.RemoteConnectionChannel.openOutboundMessage(RemoteConnectionChannel.java:114)
at org.jboss.remoting3.remote.RemoteConnectionChannel.writeMessage(RemoteConnectionChannel.java:305)
at org.jboss.as.ejb3.remote.protocol.versionone.ChannelAssociation.acquireChannelMessageOutputStream(ChannelAssociation.java:68)
at org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver.sendModuleAvailability(VersionOneProtocolChannelReceiver.java:245)
... 8 more
Possible Causes:
Client opened a connection and sent a request, then closed the connection before the server finished responding
** Related Solutions:**
How to configure timeouts for remote EJBs invoking server under heavy load in JBoss EAP 7.0 / 6.4
Client hangs on remote EJB calls during network / power outage in EAP 7 / 6
Diagnostic Steps
- Review the client and server side logging
- Review the ejb client application to see how it is setting up and configuring the remote ejb call
- Review the client and server side JBoss configuration (standalone*.xml/domain.xml / jboss-ejb-client.properties / ...)
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.