java.lang.StackOverflowError: stack size 8MB at java.lang.reflect.Method.invoke(Native Method) at com.alibaba.fastjson.util.FieldInfo.get(FieldInfo.java:351) at com.alibaba.fastjson.serializer.FieldSerializer.getPropertyValue(FieldSerializer.java:92) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:352) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) E/AndroidRuntime: at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) E/AndroidRuntime: at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) E/AndroidRuntime: at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611) at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
Returns {@link Realm} instance where this {@link RealmObject} belongs.
Youmust notcall {@link Realm#close()} against returned instance.
@return {@link Realm} instance where this object belongs to or {@code null} if this object is unmanaged.
@throws IllegalStateException if this object is an instance of {@link DynamicRealmObject}
or this object was already deleted or the corresponding {@link Realm} was already closed. */ public Realm getRealm() { return getRealm(this); }
/**
* returns {@link Realm} instance where the {@code model} belongs.
* <p>
* You <b>must not</b> call {@link Realm#close()} against returned instance.
*
* @param model an {@link RealmModel} instance other than {@link DynamicRealmObject}.
* @return {@link Realm} instance where the {@code model} belongs or {@code null} if the {@code model} is unmanaged.
* @throws IllegalArgumentException if the {@code model} is {@code null}.
* @throws IllegalStateException if the {@code model} is an instance of {@link DynamicRealmObject}
* or this object was already deleted or the corresponding {@link Realm} was already closed.
*/
public static Realm getRealm(RealmModel model) {
if (model == null) {
throw new IllegalArgumentException(MSG_NULL_OBJECT);
}
if (model instanceof DynamicRealmObject) {
throw new IllegalStateException(MSG_DYNAMIC_OBJECT);
}
if (!(model instanceof RealmObjectProxy)) {
return null;
}
final BaseRealm realm = ((RealmObjectProxy) model).realmGet$proxyState().getRealm$realm();
realm.checkIfValid();
if (!RealmObject.isValid(model)) {
throw new IllegalStateException(MSG_DELETED_OBJECT);
}
return (Realm) realm;
}
14条答案
按热度按时间92vpleto1#
堆栈信息是怎样的?
btqmn9zl2#
java.lang.StackOverflowError: stack size 8MB
at java.lang.reflect.Method.invoke(Native Method)
at com.alibaba.fastjson.util.FieldInfo.get(FieldInfo.java:351)
at com.alibaba.fastjson.serializer.FieldSerializer.getPropertyValue(FieldSerializer.java:92)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:352)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
E/AndroidRuntime: at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
E/AndroidRuntime: at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
E/AndroidRuntime: at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:611)
at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:146)
wa7juj8i3#
heap.zip
vulvrdjw4#
是不是get方法里有new对象哈
yquaqz185#
4.1.0的RealmObject里面多了这两个方法,3.7.2没有,所以4.1.0版本序列化的时候会把realm对象序列化出来
/**
Returns {@link Realm} instance where this {@link RealmObject} belongs.
Youmust notcall {@link Realm#close()} against returned instance.
@return {@link Realm} instance where this object belongs to or {@code null} if this object is unmanaged.
@throws IllegalStateException if this object is an instance of {@link DynamicRealmObject}
or this object was already deleted or the corresponding {@link Realm} was already closed.
*/
public Realm getRealm() {
return getRealm(this);
}
7dl7o3gd6#
我也发现同样的报错,之前用着正常,添加了一个style字段,然后migration后,就报这个问题了。
有想找其他库替代的想法了
bqujaahr7#
你看看是不是你有什么get方法被死循环调用了
c8ib6hqw8#
@destinyd@LambdaV5
检查一下是不是get方法中有new 对象?
ijnw1ujt9#
public Realm getRealm() {
return getRealm(this);
}
这个是因为里面的getrealm引用了this,所以又会序列化这个对象,然后就死循环了
vs3odd8k10#
@wenshao
get里面没有new对象
我现在处理的办法,是中间再建立一个非继承RealmObject的对象,然后手动转移数据,然后toJSONString 才没有问题
r6hnlfcb11#
@wenshao@LambdaV5@destinyd
唉,fastjson 与 realm 的兼容 真是个大坑,
尝试了各种方法,目前已解决,尚未发现新引入问题
考虑把代码推到
自动化接口与文档 ORM 库 APIJSON
Android 快速开发框架 ZBLibrary
里面的 fastjson 封装工具类 JSON.java,
但又不想多引入 Realm 这个库,
毕竟有很多用户不用它。。。
lnxxn5zx12#
打算给 fastjson 发 pull request,把 测试用例 和 解决方案 的相关代码推上去
bnl4lu3b13#
序列化的时候,传这个对象进去也可以
a9wyjsp714#
@wenshao
已发 Pull Request,加了测试用例和解决代码
#2369