Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001657 [Resin] major always 03-28-07 02:12 06-05-07 11:44
Reporter dbrakhane View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.0.20
Summary 0001657: Hessian 3.0.20 can't handle Singleton(Map)s
Description I recently tried upgrading from (the Java) Hessianlib 3.0.8 to 3.0.20 because the latter supports enums. However, it seems like 3.0.20 (in contrast to 3.0.8) can't handle Maps that are an instance of Collections.singletonMap:

Caused by: com.caucho.hessian.io.IOExceptionWrapper: java.lang.InstantiationException: java.util.Collections$SingletonMap
        at com.caucho.hessian.io.MapDeserializer.readMap(MapDeserializer.java)
        at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java)
        at com.caucho.hessian.io.HessianInput.readReply(HessianInput.java:285)
        at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java)

The problem seems to be that MapDeserializer - as long as the class is not Map.class or SortedMap.class, tries to instanciate a new object of the given type. However, Collections$SingletonMap cannot be instanciated.

I think, modifiying MapDeserializer (and ListDeserializer) so that it, when it cannot instanciate the original type, instanciates an object of HashMap (or ArrayList, respectively) instead, should fix the problem
Additional Information
Attached Files

- Relationships

- Notes
(0001903)
dbrakhane
05-10-07 06:29

Any thoughts on this one? This bug is keeping me from upgrading and using enums, respectively
 
(0002009)
ferg
06-05-07 11:44

hessian/331a
 

- Issue History
Date Modified Username Field Change
03-28-07 02:12 dbrakhane New Issue
03-28-07 02:12 dbrakhane Issue Monitored: dbrakhane
05-10-07 06:29 dbrakhane Note Added: 0001903
06-05-07 11:44 ferg Note Added: 0002009
06-05-07 11:44 ferg Assigned To  => ferg
06-05-07 11:44 ferg Status new => closed
06-05-07 11:44 ferg Resolution open => fixed
06-05-07 11:44 ferg Fixed in Version  => 3.1.2


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