当用renderNull() 或者写类似代码的时候,可以不对传进来的数据进行处理么?

因为单单用DateInputStream 接收字节流数据时,用websphere在linux部署的时候。会出现如下错误。我不确定是否是这里的错。所以想有个设置可以让action不提前对传进来的数据进行处理。

看报错。在jfinal的源码那 com.jfinal.core.ActionReporter.report。会有个

request.getParameterNames();不知道是不是这个影响了。导致流接收完之后。jfinal会报错。错误如下

SRTServletReq E com.ibm.ws.webcontainer.srt.SRTServletRequest parseParameters SRVE0133E: An error occurred while parsing parameters. {0}

                                 java.io.IOException: SRVE0216E: post body contains less bytes than specified by content-length

at com.ibm.ws.webcontainer.servlet.RequestUtils.parsePostData(RequestUtils.java:312)

at com.ibm.ws.webcontainer.srt.SRTServletRequest.parseParameters(SRTServletRequest.java:2279)

at com.ibm.ws.webcontainer.srt.SRTServletRequest.getParameterNames(SRTServletRequest.java:1874)

at com.jfinal.core.ActionReporter.report(ActionReporter.java:103)

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

at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:48)

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

at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)

at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)

at com.weixin.init.EncodeFilter.doFilter(EncodeFilter.java:37)

at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)

at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)

at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:928)

at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025)

at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3761)

at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)

at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:976)

at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)

at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:283)

at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)

at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)

at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)

at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)

at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205)

at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)


评论区

lzq1990

2018-04-28 18:44

暂时改了源码。根据render=null,让他getparams。。。。先不报错了

JFinal

2018-04-29 11:40

这个应该与 jfinal 无关,因为你已经自己接管 request.getInputStream() 了

很可能是你读数据时的数据格式不对

最后,建议你升级 jfinal 3.4

lzq1990

2018-05-02 08:59

@JFinal 测试了。是ActionReporter.report(ActionReporter.java:103)这个地方导致的,这里并没有其他参数传递过来。只有request.getHeader("xxx");里面有数据,还有的就是用DataInputStream流接收数据。如果这个里使用了request.getParameterNames()。就会报上面那个错误。所以。我暂时修改了ActionReporter的104左右成这个。他就不报错了 HttpServletRequest request = controller.getRequest();
Render render = controller.getRender();
if(render!=null){
Enumeration e = request.getParameterNames();
if (e.hasMoreElements()) {
........}}

JFinal

2018-05-02 09:02

@lzq1990 这样配置一下就可以了,不用改源码:
me.setDevMode(false)

lzq1990

2018-05-02 09:45

@JFinal 哦哦,对哦。没看到上面一层代码。谢谢了。

热门反馈

扫码入社