| Summary: | Application crash with very long messages | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Ralf Sternberg <rsternberg> | ||||
| Component: | Incubator | Assignee: | Project Inbox <rap.incubator-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P2 | CC: | sergeysavenko | ||||
| Version: | 2.1 | ||||||
| Target Milestone: | 2.2 RC1 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Ralf Sternberg
The issue might not be related to the DropDown widget at all, but to the message size. The response contains the header "Transfer-Encoding: chunked". *** Bug 412575 has been marked as a duplicate of this bug. *** Reproducible with workbench demo deployed as war in GlassFish 4. The demo crashes at startup with the same exception. Response headers of the first post request: ... Content-Type application/json;charset=UTF-8 Date Wed, 17 Jul 2013 12:24:21 GMT Server GlassFish Server Open Source Edition 4.0 Set-Cookie settingStore=1374060776553_0; Expires=Tue, 15-Oct-2013 12:24:20 GMT Transfer-Encoding chunked X-Powered-By Servlet/3.1 JSP/2.3 (GlassFish Server Open Source Edition 4.0 Java/Oracle Corporation/1.7) Created attachment 233559 [details]
Quick fix
The reason for this issue is still under investigation. Nevertheless, this patch seems to fix the problem with GlassFish 4. It replaces the usage of request.getReader() in ProtocolUtil#getClientMessage() with manually constructed buffered reader from request input stream. The problem occurs only in RAP 2.1 where the minimal JSON parser is used. I can't reproduce it with RAP 2.0.
I can't reproduce the crash from the description with Tomcat 5.5.35, 6.0.37 and 7.0.42 installed locally (Windows 7 x64). The experiments with the Glassfish 4 indicate that it's indeed a servlet container bug and that using request.getInputStream() instead of getReader() reliably works around this problem. Applied this workaround in commit e57579bf2b4b6eb80d9377ae7ec8d336a99c9d68. |