Complex Java Object --> Flex using RemoteClass








I have a complex Java Object on server side (with LCDS
running) - example below

Person is a java class with three attributes:

--> name: java.lang.String

--> age: int

--> residencyInfo: mypackage.ResidencyEnum

Person.class (implements Serializable)


|-- name (String)

|-- age (int)

|-- residencyInfo (ResidencyEnum)

mypackage.ResidencyEnum is a java 1.5 enum class containing
three ResidencyEnum public static variables named TX, MO, NY

I have an actionscript class for both these - and

I have declared

for both these, where each .as class refers to its equivalent
java class.

Now in the calling .as class, I'm requesting a REmoteObject
of type "Person".

I'm getting the Person object sent by java with "name" and

However the "residencyInfo" is coming through as null....

The error on the console is of two kinds:

Error# 1009 - Cannot access a property or method of a null
object reference.

Error #1034 - Type Coercion failed: cannot
convertObject@3kd84 to ResidencyInfo

Most examples on the web talk about how to serialize simple
java DTO/VO objects with only basic data types across LCDS to Flex.
I'm unable to find a solution to this problem.

Any help appreciated.