【Java】com.fasterxml.jackson.core.JsonParseException: Unexpected character ('C' (code 67)): Expected

fastjson升级的事情,我相信做开发的可能都做过,升级后带来一些个问题,在发请求的脚本,运行后,报错如下:

2019-10-09 15:24:12.547 - - [ERROR] pool-28-thread-1 KmsTokenImpl  get token error :
com.fasterxml.jackson.core.JsonParseException: Unexpected character ('C' (code 67)): Expected space separating root-level values
 at [Source: (String)"3C2P0s0uZr56V0mm"; line: 1, column: 3]
	at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1804) ~[jackson-core-2.9.7.jar!/:2.9.7]
	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:669) ~[jackson-core-2.9.7.jar!/:2.9.7]
	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:567) ~[jackson-core-2.9.7.jar!/:2.9.7]
	at 

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_45]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_45]

原因:由于代码中封装的JSON不是标准的JSON。

{'ctx_as':''}

将单引号改为双引号,即json的标准形式,就可以了:
 

{"ctx_as":''}

 

你可能感兴趣的:(fastjson,Java)