原因是解析的时候多了,逗号,或是 \

解决方法:一
revJson=revJson.replace("\\", "");//去掉'/'
revJson=revJson.substring(1, revJson.length()-1); //去掉头尾引号。
 
简单对象解析:
 BeanOrderIntent beanOrder = (BeanOrderIntent) DubJson.fromJson(result, BeanOrderIntent.class);
 
List解析

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的更多相关文章

  1. Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path 解决办法

    返回数据解析错误 com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT ...

  2. gson Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path

    返回数据解析错误 com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT ...

  3. android报错 Expected BEGIN_OBJECT but was STRING at line 1 column 39 path $

    我在使用retrofit和Gson配合时,出现了这个问题,疑惑中乱七八糟瞎搞了一个下午没有解决.期间怀疑Gson解析不能使用泛型(因为我的解析使用了泛型),后来又觉得可能是我的关键字正好是解析器的某个 ...

  4. 报错:org.apache.jasper.JasperException: /index.jsp (line: 1, column: 17) equal symbol expected

    现象:写了如下一个jsp文件,导入需要用到的两个包: 运行结果报错:org.apache.jasper.JasperException: /index.jsp (line: 1, column: 17 ...

  5. 异常-----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 ...

  6. 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的时候,遇到这个问题,百度之后,看到大家的解决方案 ...

  7. 报错:严重: 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 [ ...

  8. 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 ...

  9. SSH框架-unexpected token: * near line 1, column 8 [select * from tb_chaper where course_id = 2];报错解决方法

    SSH项目,访问jsp页面出现报错,控制台显示报错信息: org.springframework.orm.hibernate3.HibernateQueryException: unexpected ...

随机推荐

  1. ryu学习笔记(2) 之 ryu-manager运行报错

    http://blog.csdn.net/haimianxiaojie/article/details/48769653 ryu在使用的时候最常出现的报错是:address already in us ...

  2. Axiom3D写游戏:用Overlay实现Mesh浏览.

    从网上找了些资源,大多搜Ogre,Mesh资源,然后为了方便查看各个Mesh,以及对应骨骼动画.为了实用性,考虑放在原游戏窗口里实现.最开始打算窗口新建viewport来实现,后发现这种方式的局限性, ...

  3. Axiom3D:资源引用与加载基本流程.

    Archive:对应文件夹位置,包含文件夹,压缩文件,网络位置,包含Load,Unload,Open,Create,Remove,FineFile等主要虚方法,用于对应各具体Archive来实现. R ...

  4. checkbox批量删除功能

    参考:http://www.jb51.net/article/35338.htm 感谢作者 代码片段:jsp <c:forEach items="${infolist }" ...

  5. (笔记)Linux中的终端、控制台、tty、pty

    1>tty(终端设备的统称): tty一词源于teletypes,或者teletypewriters,原来指的是电传打字机,是通过串行线用打印机键盘阅读和发送信息的东西,后来这东西被键盘与显示器 ...

  6. android 8 wifi wifi 扫描过程

    查看一下android wifi扫描的过程. packages\apps\Settings\src\com\android\settings\wifi\WifiSettings.java public ...

  7. spatial transformer networks 这篇论文

    大致看了看这个paper, 很novel. 我的观点: 在traditional convolutional neural netwoks 中,我们通常会depend 于 extracting fea ...

  8. Linux操作_磁盘管理_增加虚拟磁盘

    环境:虚拟机 VM 12,Linux版本号 CentOS 7.3 1,在当前的虚拟机选项卡点击鼠标右键,选择“设置” 2,在弹出的对话框中左侧选中“磁盘”->点击下方“添加”按钮,在弹出的“添加 ...

  9. JSONObject相关依赖架包下载(Maven依赖下载)

    一.开发场景Java开发当中经常需要Json格式的数据,这就用到JSONObject类,本文章只提供以下两种JSONObject对应架包的下载方式.1.com.alibaba.fastjson.JSO ...

  10. Maven使用国内镜像

    ^_^ <mirrors> <!-- mirror | Specifies a repository mirror site to use instead of a given re ...