Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003981 [Hessian] major always 04-06-10 02:40 01-12-12 03:25
Reporter halid View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 4.0.3
Summary 0003981: Java Enums Deserialization Problem
Description We are using Hessian 4.0.3 as HTTP-Wrapper for our RMI-Services. Since we expanded one of our main services with a new parameter that contains EnumSet and Enums, we get deserialization problems on the client site.
I analyzed the problem comparing reference-arrays on the serializer and deserializer side, and could see that the Hessian-Deserializer for EnumSets creates one more reference in his reference-array. This difference leads to deserialization problems on all following attributes that are handled as references because of changed index of reference.
I attached a small Java-Program that reproduces this problem.
Additional Information Java Runtime: Sun jdk1.5.0_16
OS: Windows XP
Hessian: 4.0.3
Attached Files [^] (1,975 bytes) 04-06-10 02:40

- Relationships

- Notes
01-12-12 03:25

It seems the Hessian deserializer also tries to deserialize Enum types as Enums.

EnumSets are serialized through a SerializationProxy, which contains an array of its Enums and an "elementType" attribute storing their type. Now the Hessian deserializer tries to deserialze "elementType" with the EnumDeserializer instead of the ClassDeserializer, which obviously fails.

The following fix in SerializerFactory should handle this correctly:

else if (Enum.class.isAssignableFrom(cl))
  deserializer = new EnumDeserializer(cl);

else if (cl.isEnum())
  deserializer = new EnumDeserializer(cl);

- Issue History
Date Modified Username Field Change
04-06-10 02:40 halid New Issue
04-06-10 02:40 halid File Added:
09-02-10 14:17 torge Issue Monitored: torge
01-12-12 03:25 sdabek Note Added: 0005673
01-12-12 03:25 sdabek Issue Monitored: sdabek
02-15-12 09:29 babasmith Issue Monitored: babasmith

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
35 total queries executed.
28 unique queries executed.
Powered by Mantis Bugtracker