0

When my flex app tries to get a persisted entity that has at least one HashMap property I get this error: org.granite.messaging.persistence.ExternalizablePersistentMap cannot be cast to java.util.Map From what I searched, I believe that I'm missing some externalizer configuration, whitch is...... ?

This is what I have:

Entity:

@Persistent private HashMap<String, String> email;

Gas3 Generated EntityBase: (No Tide)

private var _email:IMap;

granite-config.xml:

<externalizers>
    <externalizer type="org.granite.datanucleus.DataNucleusExternalizer">
        <include annotated-with="javax.jdo.annotations.PersistenceCapable"/>
    </externalizer>
</externalizers>
GxFlint
  • 294
  • 3
  • 15
  • Maybe you have an old version (without map support). Read this answer (and all comments!) -> http://stackoverflow.com/a/14215755/1427942 and check if you have the right version of your libs. – Eich Jan 22 '13 at 09:15
  • Persistence seems to be working fine, the problem is when I try to send the retrieved entity to my Flex app. – GxFlint Jan 22 '13 at 15:12
  • After a few google searches I changed HashMap to BasicMap. Now I can send single BasicMap objects back and fourth from Java to Flex. But I still get an `ExternalizablePersistentMap cannot be cast to java.util.Map` error. – GxFlint Jan 22 '13 at 18:33

1 Answers1

0

I gave up using Maps, I can't be stuck for too long.

Everywhere that I was using HashMap or BasicMap was changed to HashSet<MyCustomMapLikeEntity>

Better than nothing...

GxFlint
  • 294
  • 3
  • 15