GWT no-dto

30 views
Skip to first unread message

François WAUQUIER

unread,
May 16, 2013, 7:48:38 PM5/16/13
to objectify...@googlegroups.com
Hi

I made a presentation at Paris Java User Group about using the same java object on the client and the server.
I talk about objectify and other frameworks.


I present it as a code example for the no-dto way and would be pleased to have feedback on it.


I have used objectify 2.2.3 for that.
It also work with 3.1
But I did not success to do the same thing with version 4.0b2

I am facing this error :

GRAVE: javax.servlet.ServletContext log: Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: Type '$Proxy65' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = [my.package.MyClass@989684559{id=1, name=Francois}

Any idea about that ?

Regards

Jeff Schnitzer

unread,
May 16, 2013, 8:41:17 PM5/16/13
to objectify...@googlegroups.com
It's almost certainly the list() method. Querying for a list() now returns an asynchronous proxy. Java serialization has a writeReplace() method that should materialize it on the fly for you, but GWT-RPC is not as smart.

For GWT, you'll have to create a new array list in your rpc method:

 public java.util.List<Jugger> list() {
return new ArrayList<Jugger>(juggerDao.list());
    }


--
You received this message because you are subscribed to the Google Groups "objectify-appengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to objectify-appen...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

François WAUQUIER

unread,
May 17, 2013, 9:53:13 AM5/17/13
to objectify...@googlegroups.com
Great news.
I'll try that.
Thanks
Reply all
Reply to author
Forward
0 new messages