Asynchronous EJB method call - org.jboss.remoting.InvocationFailureException
rexxmaster Aug 29, 2013 6:16 AMHello. I am a newbie in JBoss world and currently working on my first program. Therefore, I beg your pardon in advance if my question is trivial. However I still don't know the answer, so would be grateful if anybody could give me any advice.
The challenge is to run EJB method asynchronously for further retrieving some information or stopping.
I'm using JBoss AS version 5.0, Eclipse JUNO (plug-ins 3.8.2-4.2.2 )
I'm using AsyncResult class taken from ejb31-api-experimental-3.1.4.jar library. My business logic on server seems to work perfectly, but when the result is to be returned to the client application I receive an exception:
- >> org.braman.apps.demo.ejb.DemoStatelessRemote
- Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
- at $Proxy3.tn_mainloop(Unknown Source)
- at org.braman.apps.demo.ejb.DemoStatelessClient.main(DemoStatelessClient.java:59)
- Caused by: org.jboss.remoting.InvocationFailureException: Unable to perform invocation; nested exception is:
- java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: javax.ejb.AsyncResult
- at org.jboss.remoting.transport.socket.SocketClientInvoker.handleException(SocketClientInvoker.java:139)
- at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:886)
- at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:160)
- at org.jboss.remoting.Client.invoke(Client.java:1708)
- at org.jboss.remoting.Client.invoke(Client.java:612)
- at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
- at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
- at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
- at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
- at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
- at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
- at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:76)
- at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
- at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
- at $Proxy4.invoke(Unknown Source)
- at org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase.invoke(SessionSpecProxyInvocationHandlerBase.java:125)
- ... 2 more
- Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: javax.ejb.AsyncResult
- at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
- at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
- at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:119)
- at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1810)
- at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)
- at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
- at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1964)
- at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1888)
- at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
- at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
- at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
- at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObjectVersion2_2(JavaSerializationManager.java:238)
- at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:138)
- at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:123)
- at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.versionedRead(MicroSocketClientInvoker.java:1215)
- at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:845)
- at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:160)
- at org.jboss.remoting.Client.invoke(Client.java:1708)
- at org.jboss.remoting.Client.invoke(Client.java:612)
- at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
- at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
- at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
- at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
- at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
- at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
- at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:76)
- at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
- at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
- at $Proxy4.invoke(Unknown Source)
- at org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase.invoke(SessionSpecProxyInvocationHandlerBase.java:125)
- at $Proxy3.tn_mainloop(Unknown Source)
- at org.braman.apps.demo.ejb.DemoStatelessClient.main(DemoStatelessClient.java:59)
- at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
- ... 12 more
- Caused by: java.io.NotSerializableException: javax.ejb.AsyncResult
- at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1173)
- at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:343)
- at org.jboss.aop.joinpoint.InvocationResponse.writeExternal(InvocationResponse.java:100)
- at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1438)
- at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1407)
- at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1167)
- at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1526)
- at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1491)
- at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1409)
- at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1167)
- at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:343)
- at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.sendObjectVersion2_2(JavaSerializationManager.java:120)
- at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.sendObject(JavaSerializationManager.java:95)
- at org.jboss.remoting.marshal.serializable.SerializableMarshaller.write(SerializableMarshaller.java:120)
- at org.jboss.remoting.transport.socket.ServerThread.versionedWrite(ServerThread.java:998)
- at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:781)
- at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
- at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:522)
- at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
All my classes implement Serializable, but AsyncResult is a standard class from javax.ejb package.
Would be grateful if the community memebers can share their thoughts.
Thanks in advance.