If anyone's familiar with @Embed in TWIG... I'm having problems
serializing my HashSet of objects into a field. This was working in
JDO, now I'm stuck after a couple of hours.
Each entity implements Serializable, has getters/setters, and empty
constructors. I'm trying to store a HashSet of custom objects, and
each of those has a List<other custom objects>. I should also mention
that one of those custom objects has an enum.
What's weird is, it seems as though it's trying to serialize
IndependantEntityTranslator, a TWIG class, instead of my object. My
object is an instance of Serializable, which should have been handled
by line 1156 in ObjectOutputStream. Check the exception:
Caused by: java.io.NotSerializableException:
com.vercer.engine.persist.standard.IndependantEntityTranslator$1
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:
1156)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:
326)
at java.util.ArrayList.writeObject(ArrayList.java:570)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:
945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:
1461)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:
1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:
1150)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:
326)
at com.vercer.engine.persist.conversion.DefaultTypeConverter
$SerializableToBlob.convert(DefaultTypeConverter.java:121)
... 50 more
Here's ObjectOutputStream, with comments around line 1156:
// remaining cases
if (obj instanceof String) {
writeString((String) obj, unshared);
} else if (cl.isArray()) {
writeArray(obj, desc, unshared);
} else if (obj instanceof Enum) {
writeEnum((Enum) obj, desc, unshared);
} else if (obj instanceof Serializable) {
writeOrdinaryObject(obj, desc, unshared);
} else {
if (extendedDebugInfo) {
throw new NotSerializableException(
cl.getName() + "\n" + debugInfoStack.toString());
} else {
// LINE 1156 NEXT LINE:
throw new NotSerializableException(cl.getName());
// LINE 1156 PREVIOUS LINE
}
Thoughts?
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
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?hl=en.