6 Replies Latest reply: Feb 2, 2012 2:32 PM by Mike Brock RSS

Serious: Cannot transport an object of any HashMap subclass, including LinkedHashMap: best workaround?

navigateur Newbie

I have a custom class which extends HashMap<AnotherCustomClass, YetAnotherCustomClass>, an object of which I need to transport.

 

When returning via Errai RPC to the client I get:

ClassCastException: org.jboss.errai.common.client.types.UHashMap cannot be cast to my.package.MyCustomClass

 

EDIT: I definitely need it to work with custom subclasses, as the "YetAnotherCustomClass" also extends LinkedHashMap, and so on. Since I want this fixed quickly, should I contribute it to the Errai source code? If so, how? Or is it already fixed in Errai 2.0, or is it just a quick fix for the Errai devs to do?

 

EDIT: a simple LinkedHashMap doesn't work either.

 

What's the best workaround? Or could I be doing something else wrong (i.e. should this work already?)?

 

Cheers.