Monday, May 14, 2012

Hessian: Expected "End of Map" Exception

We've been working with Hessian services lately to send Java objects over the wire. So far the work has been trouble free, but from time to time, we run into some cryptic error messages. I'll document one here in case someone runs into a same problem.

Take the following error:

  Caused by: com.caucho.hessian.io.HessianProtocolException: expected end of map ('Z') at 'end of file'

This appear simply means, at least in our case, that the object being received by the caller of a Hessian service cannot be deserialized, either the object being transferred directly, or object contained with the transferred object's graph.

To resolve make sure every object in the graph implements java.io.Serializable.

Note: The above error came from com.caucho:hessian:jar:4.0.7.

No comments:

Post a Comment