The following causes a MarshalException -
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(_ejb.getHandle()); // <-- Throws
- whereas this (bizarre code) works -
oos.writeObject(_ejb.getHandle().getEJBObject().getHandle());
The ejb in question is a stateful session bean and the serialization is occurring on the web tier.
Is this a bug? Why should getting the handle from getEJBObject be different from getting the handle straight from the EJB itself?