If an ejb method @Asynchronous void fireAndForget(...) is called remote and the client disconnect an Exception JBAS014249 will be thrown if the async method return. 11:02:27,544 INFO [org.jboss.as.quickstarts.ejb.asynchronous.AsynchronousAccessBean] (EJB default - 1) action 'fireAndForget' finished 11:02:27,547 ERROR [org.jboss.as.ejb3] (EJB default - 1) JBAS014249: Error invoking method public abstract void org.jboss.as.quickstarts.ejb.asynchronous.AsynchronousAccess.fireAndForget(long) on bean named AsynchronousAccessBean for appname modulename jboss-ejb-asynchronous-ejb distinctname : java.lang.NullPointerException at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:322) at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$100(MethodInvocationMessageHandler.java:70) at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:203) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_25] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_25] at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_25] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25] at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25] at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final-redhat-1.jar:2.1.1.Final-redhat-1] 11:02:27,552 ERROR [org.jboss.as.ejb3] (EJB default - 1) JBAS014250: Could not write method invocation failure for method public abstract void org.jboss.as.quickstarts.ejb.asynchronous.AsynchronousAccess.fireAndForget(long) on bean named AsynchronousAccessBean for appname modulename jboss-ejb-asynchronous-ejb distinctname due to: java.io.IOException: JBAS014560: Could not open message outputstream for writing to Channel at org.jboss.as.ejb3.remote.protocol.AbstractMessageHandler.writeException(AbstractMessageHandler.java:102) at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$400(MethodInvocationMessageHandler.java:70) at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:213) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_25] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_25] at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_25] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25] at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25] at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final-redhat-1.jar:2.1.1.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.AbstractMessageHandler.writeException(AbstractMessageHandler.java:100) ... 9 more
This worked in EAP 6.0 but it doesn't in 6.1/6.2/6.3.. It's a regression but probably not really a blocker, as it doesn't seem to affect applications, just logs. Proposing for 6.4.
https://github.com/jbossas/jboss-eap/pull/1681
The fix doesn't seem to resolve the issue to me, I am still getting the exact same exception. The JBAS014249 message is (I think, at least in my case) logged here: https://github.com/jbossas/jboss-eap/blob/EAP_6.4.0.DR1-dev-2/ejb3/src/main/java/org/jboss/as/ejb3/remote/protocol/versionone/MethodInvocationMessageHandler.java#L220 so checking for isAsyncVoid only at https://github.com/jbossas/jboss-eap/blob/EAP_6.4.0.DR1-dev-2/ejb3/src/main/java/org/jboss/as/ejb3/remote/protocol/versionone/MethodInvocationMessageHandler.java#L249 isn't enough.
Jan, could you please provide more info what is your use case and exact stack trace? If your exception has been thrown at line 220, my understanding is that it happened during method invocation so logging it in such case shoud be fine.
What I wanted to say is that we are definitely not trying to avoid logging such exception alltogether.
Created attachment 939935 [details] reproducer
(In reply to Dominik Pospisil from comment #4) > Jan, could you please provide more info what is your use case and exact > stack trace? If your exception has been thrown at line 220, my understanding > is that it happened during method invocation so logging it in such case > shoud be fine. That's exactly how I understand this issue - the client disconnects WHILE the invocation is still running. My scenario is: - The client invokes an async void method - The async method starts a 5 seconds wait - The client disconnects before the method finishes This scenario used to work correctly on EAP 6.0 (without exceptions in server log). If I understand correctly, your scenario expects that the client disconnects while the server is trying to write out the invocation result, which is a really short timespan - quite unlikely to hit. My stacktrace is completely the same as in the bug description: at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:203) ----> this element shows that it occurs during result = invokeMethod(...) Attached a reproducer with my scenario.
Thanks. This is in fact manifestation of yet another issue - invocation of void async method never finishes successfully. The invokeMethod(...) should finish normally even if the client disconects. PR sent: https://github.com/jbossas/jboss-eap/pull/1707
https://github.com/jbossas/jboss-eap/pull/1707
Works fine in EAP 6.4.0.DR3, thanks.