views:

43

answers:

1

I recently came into a situation when sending a nested object from Java to Flex via a HashMap the Objects were null. More precisely:

final Map<Integer, List<String>> tempMap = new HashMap<Integer, List<String>>();

would send the keys as integers but the values were all null.

But when sending the same with String keys:

final Map<String, List<String>> tempMap = new HashMap<String, List<String>>();

the objects came thru.

Are there any restrictions in BlazeDS serialization when using complex types as keys?

+1  A: 
  1. Turn on property errors in your services.config.xml:

    <channels>
    <channel-definition id="YourChannel" class="mx.messaging.channels.AMFChannel">
    <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint" />
    <properties>
    <polling-enabled>false</polling-enabled>
    <!-- ========= -->
    <serialization>
    <ignore-property-errors>false</ignore-property-errors>
    <log-property-errors>true</log-property-errors>
    </serialization>
    <!-- ========== -->
    </properties>
    </channel-definition>
    </channels>

  2. Try to remove final keyword and try it without it. I had problems serializing final fields with blazeds

zdmytriv