Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] UncheckedPrintWriter in Jetty 9

Much appreciated, I'll watch for this fix.

Tom

On 29 Apr 2015, at 13:23, Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:


--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts

On Tue, Apr 28, 2015 at 9:35 AM, Tom Monk <tom.s.monk@xxxxxxxxx> wrote:
Hi all

Way back in 7.0.0, bug JETTY-1086 added a version of PrintWriter that throws IOExceptions rather than the strange default behaviour of swallowing them (cos obviously I can't be trusted to handle myosin exceptions!). From what I can see, although the class is still there in Jetty 9, the Response.ResponseWriter now effectively hard codes this, so there is no chance of wiring in a different writer.

The problem I have is returning fairly bulky (few 100k) XML responses to Rest requests. If the client connection is pulled while the XML transform/write is being done, the HttpWriter detects this, and throws an IOException, which is then swallowed by PrintWriter. This cycles around until the entire stream has been written, with an exception being thrown for every single character in the steam, so it takes a looooong time (hours) before my call to the xalan transformer returns (everything beyond this point is xalan/spring/jetty).

Wiring in the UncheckedPrintWriter in Response worked a charm in 8.1.x, as I got the IOException returned to me, and could handle it appropriately, so what am I suppose to do in Jetty 9, where this is no longer an option? Any advice appreciated; this is a blocker for moving to 9 for us.

Cheers

Tom
_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev

_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev

Back to the top