Mantis - Hessian
Viewing Issue Advanced Details
4165 major always 08-05-10 16:00 08-05-10 16:00
ebourg  
 
normal  
new 4.0.7  
open  
none    
none  
0004165: ArrayStoreException on deserializing a class with an unknown field
If a Hessian 2 stream contains an object definition with more fields than the class known locally, an ArrayStoreException is triggered:

java.lang.ArrayStoreException: com.caucho.hessian.io.JavaDeserializer$NullFieldDeserializer
at com.caucho.hessian.io.Hessian2Input.readObjectDefinition(Hessian2Input.java:2306)
at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2212)
at com.caucho.hessian.io.CollectionDeserializer.readLengthList(CollectionDeserializer.java:97)
at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1713)
at com.caucho.hessian.io.Hessian2Input.readReply(Hessian2Input.java:157)
at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:190)

This is annoying because if a class is updated on the server with an optional field, it crashes the clients that haven't been updated yet a rely on a older version of the class. It doesn't happen with a Hessian 1 stream.

This happens because NullFieldDeserializer in JavaDeserializer doesn't extend FieldDeserializer, so it's not possible to assign its instance to the array of FieldDeserializers created in the JavaDeserializer#createFields(int) method.

There are no notes attached to this issue.