Expand my Community achievements bar.

serialized data is null

Avatar

Level 1
I'm making a call to a RemoteObject, and everything works
swimmingly when my server method returns class A, but when I return
a class B that extends A adding no additional fields, I get a null
value on the client. Through trial and error and some documentation
study, I've found a number of reasons to get a null value on the
client such as:



* The Java classes must implement Serializable

* If either the Java or AS3 class implements Externalizable,
so must the other

* Incomplete compilation on the Java class

* The classes being deserialized in the Flash VM must have
been loaded by the Flash class loader

* All superclasses must be Serializable and meet the above
criteria



I've checked all these conditions. I've tried turning on the
logging for messaging, but it doesn't give helpful messages when it
decides it can't deserialize the data.



What else can I check and what is the best way to understand
what is going on under the covers during remote method invocation??

1 Reply

Avatar

Former Community Member


Note that the Java classes no longer need to implement
Serializable as of

Flex 2.0.



Do you have matching property accessors on the client type
for all of the

properties of B and superclass A?



Have you mapped the [RemoteClass(alias="com.whatever.B")] for
the matching

ActionScript B implementation too?









> I'm making a call to a RemoteObject, and everything
works swimmingly

> when my server method returns class A, but when I return
a class B

> that extends A adding no additional fields, I get a null
value on the

> client. Through trial and error and some documentation
study, I've

> found a number of reasons to get a null value on the
client such as:

>

> * The Java classes must implement Serializable

> * If either the Java or AS3 class implements
Externalizable, so must

> the other

> * Incomplete compilation on the Java class

> * The classes being deserialized in the Flash VM must
have been

> loaded by the

> Flash class loader

> * All superclasses must be Serializable and meet the
above criteria

> I've checked all these conditions. I've tried turning on
the logging

> for messaging, but it doesn't give helpful messages when
it decides it

> can't deserialize the data.

>

> What else can I check and what is the best way to
understand what is

> going on under the covers during remote method
invocation??

>