原因:

  如果出现类嵌套类的情况,需要将被嵌套的那个类设置为static。

比如:

    public class AA {
// 相关属性
public class BB {//会报错
// 相关属性
}
}

应该改为:

    public class AA {
// 相关属性
public static class BB {
// 相关属性
}
}

fastJson解析报错:com.alibaba.fastjson.JSONException: can't create non-static inner class instance.的更多相关文章

  1. 解决使用Redis时配置 fastjson反序列化报错 com.alibaba.fastjson.JSONException: autoType is not support

    1.问题描述 在使用redis时,配置自定义序列化redisTemplate为FastJsonRedisSerializer .  1 /** 2 * 自定义redis序列化器 3 */ 4 @Sup ...

  2. 使用Redis 配置替换fastjson 反序列化报错 com.alibaba.fastjson.JSONException: autoType is not support

    新建的GenericFastJson2JsonRedisSerializer里面添加白名 添加: static {        ParserConfig.getGlobalInstance().ad ...

  3. java后台接收json数据,报错com.alibaba.fastjson.JSONObject cannot be cast to xxx

    从前台接收json封装的list数据,在后台接收时一直报错,com.alibaba.fastjson.JSONObject cannot be cast to xxx, 使用这种方式接收可以接收 @R ...

  4. pip运行报错Fatal error in launcher: Unable to create process using pip.exe

    使用pip的时候报错Fatal error in launcher: Unable to create process using pip.exe 解决办法,升级pip python -m pip i ...

  5. pip3命令报错Fatal error in launcher: Unable to create process using '"d:\old_files\py3.6\python.exe" "E:\py3.6\Scripts\pip3.exe" list'

    cmd输入pip3 list命令报错 Fatal error in launcher: Unable to create process using '"d:\old_files\py3.6 ...

  6. 【踩坑】报错 non-static method xxx() cannot be referenced from a static context

    今天测试代码时遇到 Error:(6, 55) java: non-static method sayGoodbye() cannot be referenced from a static cont ...

  7. 解决报错:ERROR 1005 (HY000): Can't create table 'market.orders' (errno: 150)

    1.描述问题: 在这里我新建了两张表(customers_info和orders) 表一:customers_info CREATE TABLE customers_info ( c_num INT( ...

  8. fastjson转换包含date类型属性的对象时报错com.alibaba.fastjson.JSONException: For input string: "13:02:19"

    问题:time类型数据插入不进mysql数据库:调试的时候报如下错误: Caused by: java.lang.NumberFormatException: For input string: &q ...

  9. 做文件上传下载时报这个错com.alibaba.fastjson.JSONException: illegal identifier : \

    ::-exec-] DEBUG c.i.e.m.I.insertDataEmebeding - <== Updates: ::-exec-] ERROR c.i.e.c.CaseArchiveC ...

随机推荐

  1. 服务器与本地的控制工具unison

    中文文档:https://wiki.archlinux.org/index.php/Unison_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87) 下载:http://un ...

  2. Allegro PCB Design GXL (legacy) 设置自动保存brd文件

    Allegro PCB Design GXL (legacy) version 16.6-2015 菜单Setup > User Preferences... 在User Preferences ...

  3. Centos查看系统CPU个数、核心数、线程数

    1.查看 CPU 物理个数 grep 'physical id' /proc/cpuinfo | sort -u | wc -l 2.查看 CPU 核心数量 grep 'core id' /proc/ ...

  4. 华为交换机批量加入 Vlan 方法

    华为交换机单独加入vlan太麻烦,思科有批量加入vlan的方法,华为也有.要求 1~6口划分到vlan2,6~12口划分到vlan3,13~18口划分到vlan4,19~24口划分到vlan5.25, ...

  5. 前端技术之--HTML

    1.一套规则,浏览器认识的规则. 2.开发者: 学习Html规则 开发后台程序: - 写Html文件(充当模板的作用) ****** - 数据库获取数据,然后替换到html文件的指定位置(Web框架) ...

  6. Linux终端复用神器-Tmux使用梳理

    Tmux是一个优秀的终端复用软件,类似GNU Screen,但来自于OpenBSD,采用BSD授权.使用它最直观的好处就是,通过一个终端登录远程主机并运行tmux后,在其中可以开启多个控制台而无需再“ ...

  7. 获取验证码倒计时60s

    倒计时函数: function time(btns) { if (wait == 0) { btns.css("background-color","#F84C02&qu ...

  8. c#常用数值范围汇总

    short.MaxValue 32767 short.MinValue -32768 int.MaxValue 2147483647 int.MinValue -2147483648 long.Max ...

  9. ArrayList, LinkedList, Vector - dudu:史上最详解

    ArrayList, LinkedList, Vector - dudu:史上最详解 我们来比较一下ArrayList, LinkedLIst和Vector它们之间的区别.BZ的JDK版本是1.7.0 ...

  10. struggle in the ACM(一)

    struggle in the ACM(一) 2018/11/3 成为一名ACMer以后,第一次参加ACM正式比赛,果然是打铁了~ 回想起整场比赛的前前后后,其实拿到现在这个成绩,真的是情理之中却也是 ...