com.alibaba.fastjson .JSONException: For input string: “3000-01-01” or “9999-12-31”

FastJSON Parser exception after 2999 time range

Exception in thread "main" com.alibaba.fastjson.JSONException: For input string: "9999-12-31 00:00:00.000+0000"
    at com.alibaba.fastjson.parser.DefaultJSONParser.parseObject(DefaultJSONParser.java:665)
    at com.alibaba.fastjson.JSON.parseObject(JSON.java:365)
    at com.alibaba.fastjson.JSON.parseObject(JSON.java:269)
    at com.alibaba.fastjson.JSON.parseObject(JSON.java:488)
    at com.xxx.xxx.main(StpBpmVariableSetter.java:146)
Caused by: java.lang.NumberFormatException: For input string: "9999-12-31 00:00:00.000+0000"

FastJSON is known to be fixed in version 1.2.49, and can be fixed with an upgrade

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>fastjson</artifactId>
    <version>1.2.49</version>
</dependency>

 

Read More: