WebSphere6.0中程序運行過程中,不定期的會拋出這個異常~
至今還未找到問題的源頭~
糾結中~
好在不影響項目使用~
異常如下:
SRVE0133E: 剖析參數時,發生錯誤。java.io.IOException: SRVE0216E: post 主體所包含的位元組數,低於 content-length 所指定的位元組數
at com.ibm.ws.webcontainer.servlet.RequestUtils.parsePostData(RequestUtils.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.SRTServletRequest.parseParameters(SRTServletRequest.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.SRTServletRequest.getParameterNames(SRTServletRequest.java(Compiled Code))
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java(Compiled Code))
at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java(Compiled Code))
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java(Compiled Code))
at org.apache.struts.action.ActionServlet.process(ActionServlet.java(Inlined Compiled Code))
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java(Compiled Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java(Compiled Code))
at com.sdp.jpc.web.struts.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java(Compiled Code))
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java(Compiled Code))
at com.sdp.jpc.web.struts.filter.AccessControlFilter.doFilter(AccessControlFilter.java(Compiled Code))
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java(Compiled Code))
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java(Compiled Code))
at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
IBM的解釋問題原因:
WebSphere Application Server does not support double reading of the input stream
Problem(Abstract)
Calls to the getParameter family of methods fail after the input stream has been read from a request.
Cause
When a request's HTTP method is POST, the request parameters are sent with
the post form data. If the input stream is read, then the request parameters
are no longer available by way of the getParameter family of methods. The Web
Container will log the following exception:
SRTServletReq E SRVE0133E: An error occurred while parsing parameters. java.io.IOException:SRVE0216E:
post body contains less bytes than specified by content-length
at com.ibm.ws.webcontainer.servlet.RequestUtils.parsePostData(RequestUtils.java:538)
at com.ibm.ws.webcontainer.srt.SRTServletRequest.parseParameters(SRTServletRequest.java:1159)
at com.ibm.ws.webcontainer.srt.SRTServletRequest.getParameterMap(SRTServletRequest.java:1666)
at javax.servlet.ServletRequestWrapper.getParameterMap(ServletRequestWrapper.java:211)
Resolving the problem
It is working as designed. As stated in the Servlet Specification, the restriction on WebSphere**
Application Server is that it cannot call the read method on the return object from HttpServletRequest#getInputStream().
The following scenarios show how to cause this problem.
The problem occurs because:
1. When the request arrives in the server, the Web Container request wrapper object
notes the existence of parameters in the request input stream.
2. As part of filter processing the method, Class.writeToMemory() reads the parameters from the input stream.
3. Subsequently the method, Class.setParameters(), calls super.getParameterMap() (in a debug statement).
This results in the Web Container request wrapper getParameterMap() being called.
This leads to the Web Container trying to read the parameters from the input stream (as it noted in step 1)
only to find that they have already been read at step 1. This causes the observed error
(post body contains less bytes than specified by content-length).
Because the call that causes the error is in a debug statement,
does the problem go away if the debug statement is removed? Also,
is this the way the user intends the application to work?
The user has written their own request wrapper object and as
a result the Web Container request wrapper should not be involved in parsing parameters.
有没有人遇到类似情况!指教!