测试公众号获取Accesstoken,fastJSON转换错误?




	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: com/alibaba/fastjson/JSON
	at com.jfinal.weixin.sdk.api.AccessToken.<init>(AccessToken.java:36)
	at com.jfinal.weixin.sdk.api.AccessTokenApi$1.call(AccessTokenApi.java:102)
	at com.jfinal.weixin.sdk.api.AccessTokenApi$1.call(AccessTokenApi.java:97)
	at com.jfinal.weixin.sdk.utils.RetryUtils.retryOnException(RetryUtils.java:32)
	at com.jfinal.weixin.sdk.api.AccessTokenApi.refreshAccessToken(AccessTokenApi.java:97)
	at com.jfinal.weixin.sdk.api.AccessTokenApi.getAccessToken(AccessTokenApi.java:57)
	at com.jfinal.weixin.sdk.api.AccessTokenApi.getAccessTokenStr(AccessTokenApi.java:83)
	at com.jfinal.weixin.sdk.api.UserApi.getUserInfo(UserApi.java:36)
	at com.jfinal.weixin.demo.WeixinApiController.getUserInfo(WeixinApiController.java:85)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.jfinal.aop.Invocation.invoke(Invocation.java:97)
	... 29 more


下面的fastjson 转换错误
image.png

JsonStr内容如下(下例中accessToken 我删了一部分):
{"access_token":"30_5hh-skkRougAsnX5ez1fO7SRNkW_8DJPprpd_w42TbP4ZywPZiapmAuVsLBu9pHD06M9X7KcmCXAFtD81onLvGW1Fq_gSMmj6nk1rBHNmn6hRBqsWr5gnQpMbZDbOetWE1TAk3HPbfxiT","expires_in":7200}


评论区

小胖

2020-02-16 19:41

错误很明显了,Caused by: java.lang.NoClassDefFoundError: com/alibaba/fastjson/JSON,缺少jar包

xiuj

2020-02-16 22:40

缺少依赖包,fastjson.jar

热门反馈

扫码入社