博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【Gson】2.2.4 StackOverflowError 异常
阅读量:6282 次
发布时间:2019-06-22

本文共 6544 字,大约阅读时间需要 21 分钟。

正文

错误:

08-09 09:56:51.904: E/AndroidRuntime(16384): java.lang.StackOverflowError
08-09 09:56:51.904: E/AndroidRuntime(16384):     at java.lang.Class.isArray(Class.java:1044)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:331)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:355)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:117)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.Gson.getAdapter(Gson.java:353)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
08-09 09:56:51.904: E/AndroidRuntime(16384):     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)

 

原因:

 我这边的情况是序列化对象嵌套了"其他对象",而赋值的时候又是这个"其他对象"的子类,导致了这个异常。网上游遇到同样错误的建议换到1.7.1版本,我换了还是报错。

 

 

转载地址:http://nwiva.baihongyu.com/

你可能感兴趣的文章
Linux系统固定IP配置
查看>>
配置Quartz
查看>>
Linux 线程实现机制分析
查看>>
继承自ActionBarActivity的activity的activity theme问题
查看>>
设计模式01:简单工厂模式
查看>>
项目经理笔记一
查看>>
Hibernate一对一外键双向关联
查看>>
mac pro 入手,php环境配置总结
查看>>
MyBatis-Plus | 最简单的查询操作教程(Lambda)
查看>>
rpmfusion 的国内大学 NEU 源配置
查看>>
spring jpa 配置详解
查看>>
IOE,为什么去IOE?
查看>>
java 用反射简单应用,将Object简单转换成map
查看>>
Storm中的Worker
查看>>
dangdang.ddframe.job中页面修改表达式后进行检查
查看>>
Web基础架构:负载均衡和LVS
查看>>
Linux下c/c++相对路径动态库的生成与使用
查看>>
SHELL实现跳板机,只允许用户执行少量允许的命令
查看>>
SpringBoot 整合Redis
查看>>
2014上半年大片早知道
查看>>