Score
0
Watch 730 Star 1.7K Fork 729

GVPsd4324530 / fastweixinJavaApache-2.0

java.lang.NoClassDefFoundError: Could not initialize class com.github.sd4324530.fastweixin.util.JSONUtil

Open
kimmy  Opened this issue

java.lang.NoClassDefFoundError: Could not initialize class com.github.sd4324530.fastweixin.util.JSONUtil 出现这个是因为什么?

113628_pyinjava_1578918112 total 2 participants

Comments (6)

kimmy 2015-10-22 01:23

java.lang.NoSuchFieldError: WriteNonStringKeyAsString
at com.github.sd4324530.fastweixin.util.JSONUtil.(JSONUtil.java:22)
at com.github.sd4324530.fastweixin.api.config.ApiConfig$1.onResponse(ApiConfig.java:173)
at com.github.sd4324530.fastweixin.util.NetWorkCenter.doRequest(NetWorkCenter.java:277)
at com.github.sd4324530.fastweixin.util.NetWorkCenter.get(NetWorkCenter.java:153)
at com.github.sd4324530.fastweixin.api.config.ApiConfig.initToken(ApiConfig.java:169)
at com.github.sd4324530.fastweixin.api.config.ApiConfig.(ApiConfig.java:69)
at weixin.controller.Oauth2AuthenticationController.thirdAuthentication(Oauth2AuthenticationController.java:34)
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:483)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:152)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:745)

113628_pyinjava_1578918112
sd4324530 2015-10-22 09:26 owner

我本地测了把,没出现这个问题,你用的什么版本的?
是一启动就报的错还是什么情况下出现的?

kimmy 2015-10-22 23:31

我在使用oauth2.0认证时候出现的我是这么用的,你看对不对
WechatBaseObject wechatBaseObject = ResourceUtil.getWechatAppIDandAppScret();
System.out.println(wechatBaseObject.getAppID()+"=============="+wechatBaseObject.getAppsecret());//这里可以打印出来
ApiConfig apiConfig = new ApiConfig(wechatBaseObject.getAppID(),wechatBaseObject.getAppsecret());
String access_token = apiConfig.getAccessToken();
OauthAPI oauthAPI = new OauthAPI(apiConfig);
//组装回掉网页链接
String url = "http://182.92.221.34/weixinpai/oauth2/index";
String redirectUrl = oauthAPI.getOauthPageUrl(url, OauthScope.SNSAPI_USERINFO,"");

kimmy 2015-10-22 23:35

版本为

com.github.sd4324530
fastweixin
1.3.5

kimmy 2015-10-22 23:39

不是启动报错!

kimmy 2015-10-22 23:53

输入图片说明

挺郁闷的 用你的test下的测试也报错! 主要是ApiConfig config = new ApiConfig(appid, secret); //死活过不了

Sign in to comment

Assignees
Labels
Not set
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority
Java
1
https://gitee.com/pyinjava/fastweixin.git
git@gitee.com:pyinjava/fastweixin.git
pyinjava
fastweixin
fastweixin

Help Search