I have an entity with a member like this:

@Entity
public class Foo  implements Serializable{

    @OneToMany(mappedBy="foo",targetEntity=InternalText.class,
               fetch=FetchType.EAGER)  // I tried Lazy too.

     private ArrayList<InternalText>internalTextEntries;


When I try to use Foo I get this error:


Throwable occurred:
com.google.gwt.user.client.rpc.SerializationException: Type
'org.apache.openjpa.util.java$util$ArrayList$proxy' 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 =
[blah.blah.entities.internalt...@36ae36ae,
blah.bhla.entities.internalt...@3fca3fca,
blah.blah.retain.entities.internalt...@42474247,
blah.blah.entities.internalt...@48724872]
        at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:
610)
        at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:
129)
        at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
$ValueWriter$8.write(ServerSerializationStreamWriter.java:152)
        at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:
534)
        at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeClass(ServerSerializationStreamWriter.java:
700)


>From what I can tell openjpa is creating a helper representation of
ArrayList that it uses to assist in monitoring and lazy loading the
child table.  I've tried eager and lazy fetching.

I tried this:

        ArrayList<InternalText> newText = new ArrayList<InternalText>();
        for (InternalText textItem: foo.getInternalTextEntries()) {
                newText.add(textItem);
        }
        foo.setInternalTextEntries(newText);


It got past my error, but then the next layer down had trouble (Date
in the InternalText class)

Type 'org.apache.openjpa.util.java$util$Date$proxy' was not included
in the set of types which can be serialized by this
SerializationPolicy



-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to