// protected WxHandler wxHandler = new BasicWxHandler("1234567890");
@At // 拼起来的全路径就是 /weixin/msgin
@Filters
@AdaptBy(type = VoidAdaptor.class)
public View msgin(HttpServletRequest req, HttpServletResponse res) throws IOException {
System.out.println(11111);
System.out.println(res.getCharacterEncoding());
System.out.println(req.getQueryString());
Map xx = req.getParameterMap();
String postData = Streams.readAndClose(new InputStreamReader(req.getInputStream(), "utf8"));
System.out.println(postData);
return Wxs.handle(wxHandler, req, "default"); // 最后面的default,可以不写,只是个标识符.
}
signature=b7eaf99ff181e726fa4c739952a02f8d5f571fbb×tamp=1557505428&nonce=335255918&openid=ofw7L1dqcaJ5mPmxxnISprWCiVWU
<xml><ToUserName><![CDATA[gh_db3a698b1ae0]]></ToUserName>
<FromUserName><![CDATA[ofw7L1dqcaJ5mPmxxnISprWCiVWU]]></FromUserName>
<CreateTime>1557505428</CreateTime>
<MsgType><![CDATA[event]]></MsgType>
<Event><![CDATA[unsubscribe]]></Event>
<EventKey><![CDATA[]]></EventKey>
</xml>
2019-05-11 00:23:46,365 cn.core.mvc.LogTimeProcessor.process(LogTimeProcessor.java:28) DEBUG - [POST]URI=/alfx/weixin/msgin/ 352ms
2019-05-11 00:23:46,365 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) WARN - Error@/weixin/msgin/ :
java.lang.RuntimeException: java.io.IOException: Stream closed
at org.nutz.lang.Lang.wrapThrow(Lang.java:184)
at org.nutz.lang.Streams.readAndClose(Streams.java:293)
at org.nutz.weixin.util.Wxs.handle(Wxs.java:688)
at cn.wx.WeixinModule.msgin(WeixinModule.java:55)
at cn.wx.WeixinModule$FM$msgin$00511e4c15a70da1bf58aade44c3ac07.invoke(WeixinModule.java)
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:31)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at cn.core.mvc.LogTimeProcessor.process(LogTimeProcessor.java:23)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
at cn.core.mvc.MyNutFilter.doFilter(MyNutFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at cn.core.util.XFilter.doFilter(XFilter.java:25)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Stream closed
at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:355)
at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:132)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.Reader.read(Unknown Source)
at org.nutz.lang.Streams.read(Streams.java:316)
at org.nutz.lang.Streams.read(Streams.java:274)
at org.nutz.lang.Streams.readAndClose(Streams.java:290)
... 46 more