11 Replies Latest reply on Jul 3, 2013 9:48 AM by Christian von Kutzleben

    Getting StreamCorruptedException when running client from command line, works fine from within Eclipse

    Christian von Kutzleben Newbie

      Hi,

       

      I'm experiencing a strange phenomenon:

       

      We do have a JUnit test case that acts as client to beans deployed in JBoss, we run these test cases either with the Eclipse JUnit

      runner or from command line (via ant scripts). Both client and server, in both scenarios run on JDK 6.0

       

      For all normal bean invocations, that end without an exception, the behavior is identical.

       

      There is one testcase, that provokes an exception in the commit phase (by letting an XAResource throw an XAException).

       

      From within Eclipse, the result is as desired: the client receives an EJBTransactionRolledbackException.

       

      However when run from command line (i.e. ant), some error occurs when unmarshalling the beans response:

       

      Caused by: java.io.StreamCorruptedException: Unexpected byte found when reading an object: 128
           at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:750)
           at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
           at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37)
           at org.jboss.ejb.client.remoting.ProtocolMessageHandler.readAttachments(ProtocolMessageHandler.java:58)
           at org.jboss.ejb.client.remoting.InvocationExceptionResponseHandler$MethodInvocationExceptionResultProducer.getResult(InvocationExceptionResponseHandler.java:85)
           at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:272)
           at org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:46)
           at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:274)
           at org.jboss.ejb.client.ReceiverInterceptor.handleInvocationResult(ReceiverInterceptor.java:129)
           at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:262)
           at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:437)
           at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:140)
           at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)
           at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
           at $Proxy92.modifyAndStopDbBeforeCommit(Unknown Source)
           at com.versant.jpa.j2ee.jboss.test.JBossReconnectTest$1.run(JBossReconnectTest.java:40)

      Does anyone have a clue, why the behavior can be different?

      Or in general, what might cause the StreamCorruptedException we're seeing?

       

      Thank you!

       

      Christian