Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xstream版本Bug #1362

Closed
jiangzif opened this issue Jan 6, 2020 · 2 comments
Closed

xstream版本Bug #1362

jiangzif opened this issue Jan 6, 2020 · 2 comments
Labels

Comments

@jiangzif
Copy link

jiangzif commented Jan 6, 2020

简要描述

在tomcat7 jdk1.7下运行会出现ClassNotFound 阻断性错误,

模块版本情况

  • WxJava 模块名: weixin-java-mp
  • WxJava 版本号:3.5,3.6
    其他引用了xstream:1.4.11 均可能有此问题

详细描述

tomcat版本7.0.99 jdk版本1.7.71 出现java.lang.NoClassDefFoundError: java/util/Base64$Encoder

解决方案:

升级xstream版本从1.4.11到1.4.11.1

详细日志

15:39:52.653 DEBUG org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver 133 resolveException - Resolving exception from handler [public java.lang.String com.zoe.weiya.controller.WxMpPortalController.post(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)]: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: java/util/Base64$Encoder
15:39:52.654 DEBUG org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver 133 resolveException - Resolving exception from handler [public java.lang.String com.zoe.weiya.controller.WxMpPortalController.post(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)]: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: java/util/Base64$Encoder
15:39:52.654 DEBUG org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver 133 resolveException - Resolving exception from handler [public java.lang.String com.zoe.weiya.controller.WxMpPortalController.post(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)]: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: java/util/Base64$Encoder
15:39:52.655 DEBUG org.springframework.web.servlet.FrameworkServlet 993 processRequest - Could not complete request org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: java/util/Base64$Encoder
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:978) ~[spring-webmvc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) [spring-webmvc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) [spring-webmvc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) [servlet-api.jar:?]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) [spring-webmvc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) [servlet-api.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [catalina.jar:7.0.99]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.99]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat7-websocket.jar:7.0.99]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.99]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.99]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) [spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.99]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.99]
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71) [log4j-web-2.9.1.jar:2.9.1]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.99]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.99]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) [catalina.jar:7.0.99]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) [catalina.jar:7.0.99]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492) [catalina.jar:7.0.99]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:165) [catalina.jar:7.0.99]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) [catalina.jar:7.0.99]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025) [catalina.jar:7.0.99]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [catalina.jar:7.0.99]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452) [catalina.jar:7.0.99]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1195) [tomcat-coyote.jar:7.0.99]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:654) [tomcat-coyote.jar:7.0.99]
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:317) [tomcat-coyote.jar:7.0.99]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.7.0_71]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-coyote.jar:7.0.99]
at java.lang.Thread.run(Unknown Source) [?:1.7.0_71]
Caused by: java.lang.NoClassDefFoundError: java/util/Base64$Encoder
at java.lang.Class.getDeclaredConstructors0(Native Method) ~[?:1.7.0_71]
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) ~[?:1.7.0_71]
at java.lang.Class.getConstructor0(Unknown Source) ~[?:1.7.0_71]
at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_71]
at com.thoughtworks.xstream.core.JVM.(JVM.java:187) ~[xstream-1.4.11.jar:1.4.11]
at com.thoughtworks.xstream.converters.reflection.FieldDictionary.init(FieldDictionary.java:52) ~[xstream-1.4.11.jar:1.4.11]
at com.thoughtworks.xstream.converters.reflection.FieldDictionary.(FieldDictionary.java:47) ~[xstream-1.4.11.jar:1.4.11]
at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.(PureJavaReflectionProvider.java:52) ~[xstream-1.4.11.jar:1.4.11]
at me.chanjar.weixin.common.util.xml.XStreamInitializer.getInstance(XStreamInitializer.java:44) ~[weixin-java-common-3.6.0.jar:?]
at me.chanjar.weixin.mp.util.xml.XStreamTransformer.registerClass(XStreamTransformer.java:73) ~[weixin-java-mp-3.6.0.jar:?]
at me.chanjar.weixin.mp.util.xml.XStreamTransformer.(XStreamTransformer.java:25) ~[weixin-java-mp-3.6.0.jar:?]
at me.chanjar.weixin.mp.bean.message.WxMpXmlMessage.fromXml(WxMpXmlMessage.java:651) ~[weixin-java-mp-3.6.0.jar:?]
at com.zoe.weiya.controller.WxMpPortalController.post(WxMpPortalController.java:59) ~[classes/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_71]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_71]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) ~[spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:114) ~[spring-webmvc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) ~[spring-webmvc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) ~[spring-webmvc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) ~[spring-webmvc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
... 33 more
Caused by: java.lang.ClassNotFoundException: java.util.Base64$Encoder
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1951) ~[catalina.jar:7.0.99]
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1794) ~[catalina.jar:7.0.99]
at java.lang.Class.getDeclaredConstructors0(Native Method) ~[?:1.7.0_71]
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) ~[?:1.7.0_71]
at java.lang.Class.getConstructor0(Unknown Source) ~[?:1.7.0_71]
at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_71]
at com.thoughtworks.xstream.core.JVM.(JVM.java:187) ~[xstream-1.4.11.jar:1.4.11]
at com.thoughtworks.xstream.converters.reflection.FieldDictionary.init(FieldDictionary.java:52) ~[xstream-1.4.11.jar:1.4.11]
at com.thoughtworks.xstream.converters.reflection.FieldDictionary.(FieldDictionary.java:47) ~[xstream-1.4.11.jar:1.4.11]
at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.(PureJavaReflectionProvider.java:52) ~[xstream-1.4.11.jar:1.4.11]
at me.chanjar.weixin.common.util.xml.XStreamInitializer.getInstance(XStreamInitializer.java:44) ~[weixin-java-common-3.6.0.jar:?]
at me.chanjar.weixin.mp.util.xml.XStreamTransformer.registerClass(XStreamTransformer.java:73) ~[weixin-java-mp-3.6.0.jar:?]
at me.chanjar.weixin.mp.util.xml.XStreamTransformer.(XStreamTransformer.java:25) ~[weixin-java-mp-3.6.0.jar:?]
at me.chanjar.weixin.mp.bean.message.WxMpXmlMessage.fromXml(WxMpXmlMessage.java:651) ~[weixin-java-mp-3.6.0.jar:?]

@binarywang
Copy link
Owner

感谢提供重要信息

@binarywang
Copy link
Owner

3.6.5.B测试版本已修复,欢迎使用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants