5 Replies Latest reply on Oct 9, 2003 8:36 AM by jbossuser

    NotSerializableException in JBoss TransactionImpl on remote

    blak_hawk

      I am running two instances of JBoss 3.0.7, each on a Solaris box and am encountering exceptions making a remote session bean call between the two applications.

      This is essentially the code I am executing (from app-1):

      Hashtable t = new Hashtable();
      t.put(Context.PROVIDER_URL, "jnp://app-0:19099");
      InitialContext c = new InitialContext(t);
      RequestHome h = (RequestHome)c.lookup("com/blah/core/ejb/Request");
      Request s = h.create();
      s.remove();

      This code generates the following exception on the h.create():

      java.rmi.MarshalException: error marshalling arguments; nested exception is:
      java.io.NotSerializableException: org.jboss.tm.TransactionImpl
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:129)
      at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
      at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:140)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:198)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      at $Proxy131.create(Unknown Source)
      ...
      Caused by: java.io.NotSerializableException: org.jboss.tm.TransactionImpl
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
      at org.jboss.invocation.MarshalledInvocation.writeExternal(MarshalledInvocation.java:377)
      at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1262)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1243)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
      at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:265)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:124)
      ... 65 more


      At the point this code is executed on app-1 the current execution Thread is within a bean that has a TransactionContext (and has already performed some database queries). The bean that it is trying to call is located on app-0 and its deployment descriptor is set for Stateless CMP and has a trans-attribute of RequiresNew.

      I am not sure if this was a problem when I was running previous versions of JBoss or not. Am I missing something here? I didn't think what I was doing violated the J2EE spec, but maybe it does or I haven't configured it to work properly. If anyone has any ideas or needs more information I'd be very thankful!

      Cheers, James