Showing posts with label JPA. Show all posts
Showing posts with label JPA. Show all posts

com.google.gwt.user.client.rpc.SerializationException

When getting the following exception while fetching objects to the front end:

Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: Type 'org.datanucleus.store.appengine.query.StreamingQueryResult' 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.


Even when I know the object is Serializable....

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class RecipeStep implements Serializable
{
    public RecipeStep()
    {
    }



All I had to do is to REWRITE the returned LIST:

    public List<RecipeStep> fetch(Long recipeId)
    {
      ...
    steps = (List<RecipeStep>) pm.newQuery(query).execute();
...


List<RecipeStep> returnList = new ArrayList<RecipeStep>();
for(RecipeStep step: steps)
{
    returnList.add(step);
}
return returnList;
    }













As an Amazon Associate I earn from qualifying purchases.

com.google.gwt.user.client.rpc.SerializationException

When getting the following exception while fetching objects to the front end:

Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: Type 'org.datanucleus.store.appengine.query.StreamingQueryResult' 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.


Even when I know the object is Serializable....

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class RecipeStep implements Serializable
{
    public RecipeStep()
    {
    }



All I had to do is to REWRITE the returned LIST:

    public List<RecipeStep> fetch(Long recipeId)
    {
      ...
    steps = (List<RecipeStep>) pm.newQuery(query).execute();
...


List<RecipeStep> returnList = new ArrayList<RecipeStep>();
for(RecipeStep step: steps)
{
    returnList.add(step);
}
return returnList;
    }













As an Amazon Associate I earn from qualifying purchases.

apt quotation..