Millies, Sebastian wrote:
but that should not be a problem here. I am not throwing an exception,

I am simply passing one as a method parameter. -- Sebastian

Sebastian,

Ah yes, I ran into this entertaining problem when I coded the Async invocation 
code in 2.x.

Fundamentally, the problem is caused because Throwable is not serializable - as others have noted, it has a getStackTrace() method which causes the problem.

When I wanted to pass an exception as a parameter, what I did was to create a wrapper class and put the exception into the wrapper class, with the wrapper class taking care of the serialization of the exception. This did mean that I did NOT serialize the stack trace - but in an SOA world, I think that handing over stack traces between clients and services is not a good plan anyway, so I think that this is OK.

You may wish to approach the problem along similar lines.


Yours,  Mike.

Reply via email to