Mark,

The SerializedObject contains a circular reference because each child
has a back reference to the parent. So, parent->childrenList->item0-
>parent. The code for the new RPC classes appears to serialize
recursively without accounting for circular references (the existing
RemoteService RPC seems to handle without an error). I can't find any
documentation saying the GWT RPC should or should not explicitly
support circular references, so I don't know whether this is a feature
request or a bug.

I tested with your example, and removing the back reference from the
child element removed the InvocationTargetException. Though I didn't
extensively test to make sure no other issues crept up.

-Jason

On Oct 20, 12:47 am, Mark Goerdes <[email protected]> wrote:
> Hi Thobias,
>
> my example:
>
>   public SerializableObject getSerializableObject() {
>
>     SerializableObject object = new SerializableObject();
>
>     object.add(new SerializableObject());
>
>     return object;
>
>   }
>
> failed with these objects. As you can see, there is no circle, Child
> and Parent are different objects.
>
> Regards,
> Mark
>
> On 19 Okt., 23:51, Thoka <[email protected]> wrote:
>
>
>
> > Hi, perhaps a stupid question, have you tried putting in checks for
> > the parameters? Like:
>
> >   public void add(SerializableObject child) {
> >     if (child == this) {
> >        throw new IllegalArgumentException("Cannot add self as
> > child!");
> >     }
> >     child.setParent(this);
> >     children.add(child);
> >   }
>
> > ...and same for setParent(...), this does not sound like a GWT
> > issue. :)
>
> > Best regards,
>
> > Thobias
>
> > On 8 Okt, 08:52, futzi <[email protected]> wrote:
>
> > > Hi Bob,
>
> > > do you have anything new concerning my problem with tree objects and
> > > rpc?
>
> > > Regards,
> > > Mark
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to