@PersistenceCapable
public class MyEntity extends EntityBase
{
    @PrimaryKey
    @Persistent
    private String mPrimaryKey;
}

com.google.web.bindery.requestfactory.server.UnexpectedException: The domain 
type javax.jdo.identity.StringIdentity cannot be sent to the client

Is there a known workaround for this?

The problem is that JDO stores the identifier as a StringIdentity rather 
than a String and when it comes time to transmit the object to the client 
via GWT RequestFactory it's the JDO version of the object that is being 
transmitted (so it appears) rather than the MyEntity that I defined.

This only occurs when I fetch the object from the datastore.  If I 
instantiate it on the server (new MyEntity() ...) it can be sent to the 
client and if I instantiate it on the client it can be sent to the server.

When I look at the results in a debugger immediately after:
List<MyEntity> lMyEntities = (List<MyEntity>) lQuery.execute();

I get the following for: 
StreamingQueryResult.lazyResult.entityTransformer.val$acmd.managedMembers
[<field name="mKey"
    persistence-modifier="persistent"
    primary-key="true"
    null-value="none"
    default-fetch-group="true"
    embedded="false"
    unique="false">
  <column name="mKey"/>
</field>]

Which is all fine but when I look at: 
StreamingQueryResult.lazyResult.entityTransformer.val$acmd.objectidClass
javax.jdo.identity.StringIdentity

Apparently when I return from the the server request and the collection of 
objects is marshaled back to the client, that objectidClass gets marshaled 
along with it and the exception is thrown.

So my question appears to be, how can I get my objects back out (rather than 
the ones with the StringIdentity members in them)?

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/di-SGdD8FDsJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to