com.alibaba.fastjson.JSONException: syntax error, expect {, actual [, pos 0
Error com Alibaba fastjson syntax expect PoS
2023-09-27 14:28:46 时间
在使用fastjson解析的时候遇到该错误,网上查找了半天,找到位大神的帖子是说解析的实体A中有实体B,在该条json中A实体只有一个,但B实体却有多个,导致解析出错,解决办法是在A实体中定义B实体时,定义为List,这个是大神当时遇到的错误。
https://stackoverflow.com/questions/42731610/module-build-failed-referenceerror-unknown-plugin-import-specified-in-base
在使用fastjson解析的时候遇到该错误,网上查找了半天,找到位大神的帖子是说解析的实体A中有实体B,在该条json中A实体只有一个,但B实体却有多个,导致解析出错,解决办法是在A实体中定义B实体时,定义为List B ,这个是大神当时遇到的错误。我的错误不在于此。
我的错误是由于在封装json时封装的实体时List类型的,但解析的时候默认解析为一个实体,所以就出现了以上的错误
解析时的代码Moyiol_order mOrder=JSON.parseObject(ordersinfo, Moyiol_order.class);
封装时的代码List Moyiol_order result;
JSON.toJSONString(result);
只要在封装的时候将result取出要用的实体封装就可以了,如果需要封装多个实体,可以借鉴大神的思想自己寻找一下方法。
http://blog.csdn.net/jadyer/article/details/24395015
https://stackoverflow.com/questions/42731610/module-build-failed-referenceerror-unknown-plugin-import-specified-in-base
相关文章
- mysqlslap: Error when connecting to server: 1064 Reach limit of connections
- mysql初始化时报错bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory的处理
- error CS8773: "Feature 'global using directive' is not available in C# 9.0" after downgrade from net6.0 to net5.0
- jQuery ajax() success, error VS .done(), .fail()
- 报错:ERROR ParcelUpdateService:com.cloudera.parcel.components.ParcelDownloaderImpl: Unable to retrieve remote parcel repository manifest
- com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax;
- raw.githubusercontent.com:443连接的OpenSSL SSL_ERROR_SYSCALL
- ubuntu 18.04上执行buildman安装了交叉工具链之后编译报错"aarch64-linux/7.3.0/cc1: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory"如何处理?
- 编译openwrt时报错:g++: internal compiler error: Killed (program cc1plus)
- Error querying database. Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Fail
- 【DB2】DBeaver连接DB2数据库驱动安装时报错Error resolving dependencies Maven artifact ‘maven:/com.ibm.db2:jcc:RELEA
- 华为游戏登录,解析凭证 Access Token 接口报 {“error”:“invalid session”}
- Mybatis出错: Cause: org.apache.ibatis.reflection.ReflectionException: Error instantiating class com.cyf.pojo.User with invalid types () or values ()
- The connection to adb is down, and a severe error has occured完整解决办法
- VUE-014-c1xx : fatal error C1083: 无法打开源文件: xxx
- Java学习-066-Mybatis + druid 报错: com.alibaba.druid.sql.parser.ParserException: syntax error, error in :'code LIKE "%"?"%"
- Maven报错 解决方案。ERROR: No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id
- PowerDesigner 逆向工程Non SQL Error : Could not load class com.mysql.jdbc.Driver
- MySQL 5.6 解决InnoDB: Error: Table "mysql"."innodb_table_stats" not found.问题
- LittlevGL移植( Error: L6406E: No space in execution regions ...解决方法)
- 【vue踩坑记录】3、“Error in render: "TypeError: Cannot read property '0' of undefined"”渲染错误问题
- [已解决]报错:Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop102:10000
- 合并数据失败 consolidation failed error code 999999
- Tomcat7启动报Error listenerStart错误--转载
- 【亲测好使】Error querying database. Cause: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException
- Spring initializr Error:java: 读取C:Users….m2repositorycomfasterxmljacksoncorejackson-databind2.9.8jackson-databind-2.9.8.jar时出错; ZipFile invalid LOC header (bad signature)
- Android Studio Error:Could not find com.android.tools.build:gradle
- Qt Createor error writing to -: Invalid argument