вс, 8 дек. 2019 г. в 08:09, Jerry Malcolm <techst...@malcolms.com>:
>
> I have ajax code that sends requests to TC in a REST-style process.  I
> send the parms url-encoded in the body.  This has worked untouched
> literally for years.  I have some new data objects in my db that "should
> be" sending the same type of requests through the same javascript
> routines.  But for some inexplicable reason, the HttpServletRequest
> object is randomly deciding to not process the parms.  When I try to
> enumerate the parms, I get none. Any parm I request comes back not
> found.  I added some code to read the body myself (request.getReader(),
> etc).  When the parms are available as it normally works, the reader is
> empty, which is what I would expect since it's been read by the request
> obj.  But when the request object tells me I have no parms, I can read
> the entire url-encoded parm string from the reader, which if I
> understand things, means the request object never tried to read the
> stream, unless it somehow restores the stream after a read (??).  But
> the important point I determined is that the parms are indeed present in
> the body... just not processed.
>
> [...]

I usually have the following in the pattern of AccessLogValve in my
configurations:

[%{org.apache.catalina.parameter_parse_failed}r
%{org.apache.catalina.parameter_parse_failed_reason}r]

Those request attributes are set in Tomcat whenever a problem is
encountered by parameter parsing, e.g. an IOException if a client
aborts the request. (The methods to process parameters in Servlet API
do not have a way to report any errors). Those attributes can be used
by org.apache.catalina.filters.FailedRequestFilter

http://tomcat.apache.org/tomcat-9.0-doc/config/filter.html#Failed_Request_Filter

You may look where those attributes are set in the source code.

Mark wrote:
> Issues like this can be caused if a reference to a request or response
> is retained longer than it should be. You can try setting:
> -Dorg.apache.catalina.connector.RECYCLE_FACADES=true

+1.

https://cwiki.apache.org/confluence/x/yColBg
https://cwiki.apache.org/confluence/display/TOMCAT/Troubleshooting+and+Diagnostics#TroubleshootingandDiagnostics-CommonTroubleshootingScenario

> I fired up my Windows laptop TC 9.x and got the exact same symptoms.

You may also try with Tomcat 9.0.30 - release candidate is available
and is currently being voted - see dev@ mailing list.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to