Note that there are some explanatory texts on larger screens.

plurals
  1. PORequest parameters are dropped in Tomcat
    primarykey
    data
    text
    <p>Client code:</p> <pre><code> FormDataBodyPart f = new FormDataBodyPart(...); FormDataBodyPart f2 = new FormDataBodyPart(...); MultiPart multiPart = new MultiPart(); multiPart.bodyPart(f); multiPart.bodyPart(f2); //Execute Call WebResource wr = resource().path(Url.X); wr = wr.queryParam("subjectId", "value_something"); ClientResponse response = wr.type(MediaType.MULTIPART_FORM_DATA).post(ClientResponse.class, multiPart); </code></pre> <p>Server code:</p> <pre><code>String id = req.getParameter("subjectId"); </code></pre> <p>req is HttpServletRequest - injected by spring</p> <pre><code>@Context protected HttpServletRequest httpServletRequest; </code></pre> <p>Problem: on some of the environments the <code>id</code> parameter retrieved is null. In the filter we print the while request parameters map to log in it is just empty.<br/> We believe the problem is on server side since the same client executed vs. different environments gives different result.<br/> On some servers the parameter is always empty, from all clients, and on other environments the parameter is always there, from all clients.<br/> So... it looks like the problem on the Tomcat side, but... where?</p> <p>Update: result from wireshark on server:</p> <pre><code>[Malformed Packet: MIME multipart] Expert Info (Error/Malformed): Malformed Packet (Exception occurred) Message: Malformed Packet (Exception occurred) </code></pre> <p>on some servers despite the error - the parameter is there and on others the param is missing.</p> <p><br/> <br/> <strong>Update</strong>: the logged request by AccessLogValve contains the parameter<br> 127.0.0.1 - - [26/Nov/2012:03:04:58 -0800] "POST /api/get-retrieve?<strong>x=y</strong> HTTP/1.1" 200 16<br/> So, probably the problem is somewhere in the Tomcat throwing out those params...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload