Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2
原因是解析的时候多了,逗号,或是 \
Gson gson = new Gson();
List<BeanOrderConfirm> beanOrderConfirm = gson.fromJson(deliveryData, new TypeToken<List<BeanOrderConfirm>>() {}.getType());
解决方法二:
这个问题自己对照Bean类, 原因出在Sting 和List 的转换错误,或是String 和其它转错误
1.把集合改成数组即可
2.把String转成json需要的格式
Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2的更多相关文章
- Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path 解决办法
返回数据解析错误 com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT ...
- gson Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path
返回数据解析错误 com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT ...
- android报错 Expected BEGIN_OBJECT but was STRING at line 1 column 39 path $
我在使用retrofit和Gson配合时,出现了这个问题,疑惑中乱七八糟瞎搞了一个下午没有解决.期间怀疑Gson解析不能使用泛型(因为我的解析使用了泛型),后来又觉得可能是我的关键字正好是解析器的某个 ...
- 报错:org.apache.jasper.JasperException: /index.jsp (line: 1, column: 17) equal symbol expected
现象:写了如下一个jsp文件,导入需要用到的两个包: 运行结果报错:org.apache.jasper.JasperException: /index.jsp (line: 1, column: 17 ...
- 异常-----freemarker.template.TemplateException: Expected collection or sequence. datas evaluated instead to freemarker.core.HashLiteral$SequenceHash on line 7, column 18 in inc/select.ftl.
1.错误描述 六月 26, 2014 11:26:27 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proc ...
- Exception in thread "main" expected '<document start>', but found BlockMappingStart in 'reader', line 23, column 2: nimbus.host: "master"
平台:centos-6.3-i386 jdk-7u51 storm 0.9.1 python 2.6.6 hadoop 1.2.1 启动storm的时候,遇到这个问题,百度之后,看到大家的解决方案 ...
- 报错:严重: Servlet.service() for servlet [jsp] in context with path [/20161116-Struts2-6] threw exception [/index.jsp (line: 13, column: 20) No tag "textfiled" defined in tag library imported with prefix
严重: Servlet.service() for servlet [jsp] in context with path [/20161116-Struts2-6] threw exception [ ...
- ORA-06550:line 1,column 7;PLS-00201:indentifer '存储过程' must be declared;...PL/SQL Statement ignored 问题
前段时间由于修改SMES系统,出现了一个问题. ORA-06550:line 1,column 7;PLS-00201:indentifer '存储过程' must be declared;...PL ...
- SSH框架-unexpected token: * near line 1, column 8 [select * from tb_chaper where course_id = 2];报错解决方法
SSH项目,访问jsp页面出现报错,控制台显示报错信息: org.springframework.orm.hibernate3.HibernateQueryException: unexpected ...
随机推荐
- OSPF中 hello报文的 内容
邻居关系通过hello报文来建立.Hello报文中包含如下一些内容: 1.始发路由器的router-id 2.始发路由器接口的area-id 3.始发路由器接口的地址掩码 4.始发路由器接口的auth ...
- Ogre2.1 结合OpenGL3+高效渲染
在DX10与OpenGL3+之前,二者都是固定管线与可编程管线的混合,其中对应Ogre1.x的版本,也是结合固定与可编程管线设计.转眼到了OpenGL3+与DX10后,固定管线都被移除了,相对应着色器 ...
- SpagoBI 教程 Lesson 3: Highchart Dashboards
SpagoBI Lesson 3: Highchart Dashboards Business Intelligence dashboards Every car comes with a dash ...
- Spring JDBC SqlUpdate类示例
org.springframework.jdbc.object.SqlUpdate类提供了表示SQL更新的可重用操作对象. 使用到的 Student 表的结构如下 - CREATE TABLE Stu ...
- AngularJS $http模块POST数据,后台接受不到
1.问题: 后端接收不到AngularJs中$http.post发送的数据,总是显示为null 示例代码: $http.post(/admin/KeyValue/GetListByPage, { pa ...
- Linux入门教程:如何检查Linux系统的最后重启时间
问题: 是否有一个命令可以快速地检查系统已经运行了多久? 也就是我怎么知道Linux系统最后的重启时间? 有许多方法来查询系统最后的重启时间. 方法一 第一种方法是使用last命令. $ last r ...
- C# 校验给定的ip地址是否合法
函数用于检测ip地址格式是否合法,包括ip的组成格式,每隔段是否不超过255等,但这个函数不能验证这个ip地址是否可以ping通. /// <summary> /// 验证IP地址是否合法 ...
- HTTP Analyzer——WEB调试代理
HTTP Analyzer 是一个实时的web调试代理,如果你对Fiddler不陌生的话,HTTP Analyzer 就是和Fiddler具备一样功能的调试代理. 推荐这个软件而不推荐Fiddler的 ...
- 小程序笔记三:幻灯片swiper 和图片自定义高度
滑动组件:scroll-view wxml代码 <view> <scroll-view scroll-x="true" class="tab-h&quo ...
- Redis Crackit漏洞利用和防护
注意:本文只是阐述该漏洞的利用方式和如何预防.根据职业道德和<中华人民共和国计算机信息系统安全保护条例>,如果发现的别人的漏洞,千万不要轻易入侵,这个是明确的违法的哦!!! 目前Redis ...