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

解决方法:一
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. USB2.0学习笔记连载(十七):keil实现寄存器的配置及相关函数讲解(一)

    首先要实现对寄存器的配置,可以参考手册<Development kit  User Guide>,如下图所示: 此文件包含在 文件中.上述的应用文档详细介绍了如何利用KEIL实现对固件程序 ...

  2. github开源库(三)

    41.android-swipelistview SwipeListView是一个Android List View实现,实现了自定义ListView单元格,可通过滑动来显示扩展面板.开发者可直接登陆 ...

  3. e614. Setting the Initial Focused Component in a Window

    There is no straightforward way to set the initial focused component in a window. The typical method ...

  4. jQuery 文件上传插件:uploadify、swfupload

    jQuery 文件上传插件: uploadify.swfupload

  5. Hadoop分布式集群部署(单namenode节点)

    Hadoop分布式集群部署 系统系统环境: OS: CentOS 6.8 内存:2G CPU:1核 Software:jdk-8u151-linux-x64.rpm hadoop-2.7.4.tar. ...

  6. Miniconda 安装测试

    背景: conda 是一个python的计算环境,minicoda 可以看做是conda的精简版 官网: https://conda.io/miniconda.html 安装: miniconda 支 ...

  7. FastFel解析一个公式的步骤

    FastFel 查看源码后,理解的运算步骤: 1) 创建一个 FelEngine,FelEngine fel = new FelEngineIml(); 2) 将表达式 exp 解析成为一个节点树 F ...

  8. iOS: 自动增高的 textView

    如 iPhone 内应用“信息”的输入框一样,输入文字过多或者输入换行,输入框可以随着内容自动变化.主要是计算内容的尺寸并相应更改输入框的frame.具体表现在: 更改输入框的 frame.origi ...

  9. awk调用shell

    为什么会有这份记录:在帮同学传文件至服务器时,使用了scp,因此链接属性没有建立好,所以向通过awk完成.(更好的是通过tar传递) 附:awk中调用shell的方法. 参考:http://hi.ba ...

  10. Xcode不太常见又实用的小技巧

    备份, 原文: http://rocry.com/2012/12/17/xcode-tips/ 让代码中的TODO和FIXME变成Warning 选中某个Target > Build Phase ...