google-code-export / objectify-appengine

Automatically exported from code.google.com/p/objectify-appengine
MIT License
1 stars 0 forks source link

Map and List returned by Objectify is not serializable by GWT #148

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a list of an object using query and .list()
2. Return that list to stream to GWT interface
3. Fails, Proxy type not stream-able

What is the expected output? What do you see instead?
Either the proxied object is streamed or we can eaisly
access the object to stream as a return value for the gwt remote interface.

What version of the product are you using? On what operating system?
4.0 on app engine 1.7.5 and GWT 2.5

Please provide any additional information below.

eg, the following wont stream, i was expecting it to.
 @Override
  public List<MappingFileInfo> getMappingFiles() throws IllegalArgumentException
  {
    List<MappingFileInfo> list = ObjectifyService.ofy().load().type(MappingFileInfo.class).list();
    return list;
  }

The following will..
 @Override
  public List<MappingFileInfo> getMappingFiles() throws IllegalArgumentException
  {
    List<MappingFileInfo> list = ObjectifyService.ofy().load().type(MappingFileInfo.class).list();
    return new ArrayList<MappingFileInfo>(list);
  }

Original issue reported on code.google.com by mat...@winters.org.nz on 27 Feb 2013 at 2:28

GoogleCodeExporter commented 9 years ago
It's probably possible to make this work with standard java serialization using 
writeReplace(), however, GWT serialization does not recognize writeReplace.  So 
there's really nothing Objectify can do to help your specific situation.

Star this:  https://code.google.com/p/google-web-toolkit/issues/detail?id=3303

If that ever changes, I'll up the priority of this enhancement.

Original comment by lhori...@gmail.com on 29 Mar 2013 at 7:56

GoogleCodeExporter commented 9 years ago
The writeReplace approach works for standard java serialization. At this point 
the bug is a GWT issue.

Original comment by lhori...@gmail.com on 14 Apr 2014 at 12:49