Flex 2 weak typing and ClassCastException error

(TechNote) While developing your Flex 2 application with Flex Data Services, you may see a ClassCastException runtime exception in the Flash Player and a warning message similar to the following:

“Your sync, create, or update method is being called with a weak typed
object (flex.messaging.io.amf.ASObject – a subclass of java.util.Map)
even though you did not return a weak type from your get/fill method.
If you do not define actionscript classes for your java classes and
mark them with RemoteClass metadata they will get turned into Maps on
the way in. If you do want to use only anonymous objects on the client
and you have no associations you might consider setting an item-class
in the destination to have the server convert the Map to your class