fastjson使用方法JSONObject.getInteger报错 java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.fastjson.util.TypeUtils
去GitHub搜了下,是个bug,已经修复了升到对应版本就行了。
JSONObject.getInteger(String key) 报错:TypeUtils NoClassDefFoundError:https://github.com/alibaba/fastjson2/issues/175
我的版本是2.0.1,升到2.0.3就可以了。
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>2.0.3</version>
</dependency>