jfinal 微信 post请求,后台getRawData()时有时候会报错

希望大神给解决下研究了好几天了

image.png

[ERROR]-[Thread: http-apr-58080-exec-1]-[com.jfinal.core.ActionHandler.handle()]: /henzApp/setAppBill

java.lang.RuntimeException: java.io.IOException

at com.jfinal.kit.HttpKit.readData(HttpKit.java:280)

at com.jfinal.core.Controller.getRawData(Controller.java:101)

at com.autocnd.qyweixin.henz.controller.HenzAppController.setAppBill(HenzAppController.java:34)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.jfinal.aop.Invocation.invoke(Invocation.java:75)

at com.jfinal.core.ActionHandler.handle(ActionHandler.java:89)

at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:89)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2549)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2538)

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

at org.apache.coyote.http11.InternalAprInputBuffer.fill(InternalAprInputBuffer.java:628)

at org.apache.coyote.http11.InternalAprInputBuffer$SocketInputBuffer.doRead(InternalAprInputBuffer.java:657)

at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:137)

at org.apache.coyote.http11.InternalAprInputBuffer.doRead(InternalAprInputBuffer.java:541)

at org.apache.coyote.Request.doRead(Request.java:438)

at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:290)

at org.apache.catalina.connector.InputBuffer.realReadChars(InputBuffer.java:353)

at org.apache.tomcat.util.buf.CharChunk.substract(CharChunk.java:447)

at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:416)

at org.apache.catalina.connector.CoyoteReader.read(CoyoteReader.java:108)

at org.apache.catalina.connector.CoyoteReader.readLine(CoyoteReader.java:163)

at com.jfinal.kit.HttpKit.readData(HttpKit.java:266)

... 27 more


评论区

橘瑠衣

2019-06-25 09:31

$.post("/henzApp/setAppBill", JSON.stringify(data), function(data,status) {}, "json") ;前端请求方式

JFinal

2019-06-25 09:51

@橘瑠衣 前端的请求方式决定了不能使用 getRawData()

只能使用 getPara(...)

通过查看控制台输出的 jfinal action reporter 中的 parameter 这一栏,就知道如何 getPara 了

橘瑠衣

2019-06-25 09:57

@JFinal 好的谢谢

热门反馈

扫码入社