1 Reply Latest reply on Nov 13, 2013 8:35 AM by Vladimir T.

    Asynchronous EJB method call - org.jboss.remoting.InvocationFailureException

    Vladimir T. Newbie

      Hello. 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:


      1. >> org.braman.apps.demo.ejb.DemoStatelessRemote 
      2. Exception in thread "main" java.lang.reflect.UndeclaredThrowableException 
      3.     at $Proxy3.tn_mainloop(Unknown Source) 
      4.     at org.braman.apps.demo.ejb.DemoStatelessClient.main(DemoStatelessClient.java:59) 
      5. Caused by: org.jboss.remoting.InvocationFailureException: Unable to perform invocation; nested exception is:  
      6.     java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: javax.ejb.AsyncResult 
      7.     at org.jboss.remoting.transport.socket.SocketClientInvoker.handleException(SocketClientInvoker.java:139) 
      8.     at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:886) 
      9.     at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:160) 
      10.     at org.jboss.remoting.Client.invoke(Client.java:1708) 
      11.     at org.jboss.remoting.Client.invoke(Client.java:612) 
      12.     at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60) 
      13.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 
      14.     at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61) 
      15.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 
      16.     at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65) 
      17.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 
      18.     at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:76) 
      19.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 
      20.     at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62) 
      21.     at $Proxy4.invoke(Unknown Source) 
      22.     at org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase.invoke(SessionSpecProxyInvocationHandlerBase.java:125) 
      23.     ... 2 more 
      24. Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: javax.ejb.AsyncResult 
      25.     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) 
      26.     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) 
      27.     at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:119) 
      28.     at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1810) 
      29.     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769) 
      30.     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) 
      31.     at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1964) 
      32.     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1888) 
      33.     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771) 
      34.     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) 
      35.     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) 
      36.     at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObjectVersion2_2(JavaSerializationManager.java:238) 
      37.     at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:138) 
      38.     at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:123) 
      39.     at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.versionedRead(MicroSocketClientInvoker.java:1215) 
      40.     at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:845) 
      41.     at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:160) 
      42.     at org.jboss.remoting.Client.invoke(Client.java:1708) 
      43.     at org.jboss.remoting.Client.invoke(Client.java:612) 
      44.     at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60) 
      45.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 
      46.     at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61) 
      47.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 
      48.     at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65) 
      49.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 
      50.     at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:76) 
      51.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 
      52.     at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62) 
      53.     at $Proxy4.invoke(Unknown Source) 
      54.     at org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase.invoke(SessionSpecProxyInvocationHandlerBase.java:125) 
      55.     at $Proxy3.tn_mainloop(Unknown Source) 
      56.     at org.braman.apps.demo.ejb.DemoStatelessClient.main(DemoStatelessClient.java:59) 
      57.     at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72) 
      58.     ... 12 more 
      59. Caused by: java.io.NotSerializableException: javax.ejb.AsyncResult 
      60.     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1173) 
      61.     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:343) 
      62.     at org.jboss.aop.joinpoint.InvocationResponse.writeExternal(InvocationResponse.java:100) 
      63.     at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1438) 
      64.     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1407) 
      65.     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1167) 
      66.     at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1526) 
      67.     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1491) 
      68.     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1409) 
      69.     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1167) 
      70.     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:343) 
      71.     at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.sendObjectVersion2_2(JavaSerializationManager.java:120) 
      72.     at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.sendObject(JavaSerializationManager.java:95) 
      73.     at org.jboss.remoting.marshal.serializable.SerializableMarshaller.write(SerializableMarshaller.java:120) 
      74.     at org.jboss.remoting.transport.socket.ServerThread.versionedWrite(ServerThread.java:998) 
      75.     at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:781) 
      76.     at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695) 
      77.     at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:522) 
      78.     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.