Error when putting a java object in pipline

I have a simple java domain object ( get and set methods) and Iam trying to put this object in the pipeline via a java service. But if the domain object implements java.io.Serializable ,then I get a ClassCastException:java.lang.Integer, but if it does not inplement java.io.Serializable ,then i works fine. I need the domain object to be Serializable ,so I cannot change the implementation.
Can somebosy let me know why this would happen and what is the work around.

Where do you get the ClassCastException?
In Developer when the service results are displayed?
You may need to put the class on the Developer’s JVM ClassPath.

I am also getting a similar problem. When I try to put and XML DOM document into the IDataCursor
(IDataUtil.put( pipelineCursor, “xmlDocument”, (Object)xmlDocument );
), I am getting the exception. What could I have done wrong?

java.lang.ClassCastException: java.lang.Integer

at com.wm.util.coder.IDataBinCoder._decode(IDataBinCoder.java:636)

at com.wm.util.coder.IDataBinCoder._decode(IDataBinCoder.java:639)

at com.wm.util.coder.IDataBinCoder.decode(IDataBinCoder.java:215)

at com.wm.driver.comm.b2b.http.SessionHTTPLink.transportMsg(SessionHTTPLink.java:95)

at com.wm.driver.comm.b2b.http.HTTPLink$HTTPSendReceive.run(HTTPLink.java:446)

at java.lang.Thread.run(Thread.java:484)

The module the serializes data between IS and Java clients is IDataBinCoder. This class supports platform/release/JVM neutral encoding for many data types and a number of interfaces.

If a Java Object does not support any of the formats that it does special encoding for, it uses Java Serialization.

One workaround way to get rid of the error is to put the DOM classes on the Developer classpath.

Since Developer doesn’t currently do anything special to display the DOM object in the results panel, them the object is in the pipeline to be passed to another service. Have the last service that cares about the object drop it from the pipeline before returning results to Developer (this does not work if you are single stepping through the flow, but will avoid the problem if you step over the set of services that pass around DOM objects).