Hello,
I am having a problem serialising a javax.ejb.Handle to a stateful session bean, and I suspect JBoss may be responsible.
The code Im using to serailise the EJB handle is:
Handle handle = mybean.getHandle();
FileOutputStream fos = new FileOutputStream("myhandle.ser");
ObjectOutputStream outStream = new ObjectOutputStream(fos);
outStream.writeObject(handle);
outStream.flush();
fos.close();
This works fine when mybean is an instance of the remote interface of a stateless session bean. However, when mybean is an instance of a statefull session bean, I get the following stack trace from JBoss:
java.rmi.ServerException: Invalid remote object; nested exception is:
java.rmi.MarshalException: Invalid remote object
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:140)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:176)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:183)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderIntercep
tor.java:156)
at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:370)
at org.jboss.ejb.Container.invoke(Container.java:687)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:100)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:88)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:48)
at org.jboss.proxy.ejb.StatefulSessionInterceptor.invoke(StatefulSessionInterceptor.java
:119)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:82)
at $Proxy62.logon(Unknown Source)
This exception is thrown when execution reaches the line:
outStream.writeObject(handle);
Has anyone been able to serialize a statefull session bean in JBoss? If so, what code are you using?