0

the API of Jersey's HttpUrlConnectorProvider states that there is a bug in Java's HttpURLConnection:

Due to a bug in the chunked transport coding support of HttpURLConnection that causes requests to fail unpredictably [...]

Sadly there is not link to a reported bug nor any information about the affected version. So does anyone know which bug is referred to?

Thanks, Malte.

Malte
  • 165
  • 2
  • 10
  • This [bug](https://java.net/jira/browse/JERSEY-2024) about *HttpUrlConnector throws OutOfMemoryError for large entities* looks promising. – Harald K Apr 21 '16 at 09:54
  • 1
    @haraldK That bug also just states "It looks like there is a bug in HttpURLConnection which cause failures from time to time. Therefore it is by default disabled". But it does not point to the bug in HttpURLConnection. – Malte Apr 21 '16 at 10:05
  • @Malte It also states that a workaround is to use chunked streaming mode, so the bug isn't in chunked streaming mode. I've never encountered any bugs in `HttpURLConnection`. – user207421 Apr 21 '16 at 10:14
  • @EJP Absolutely. But if you read it, you'll find that it's a bug report for Jersey's `HttpUrlConnector` which uses `java.net.HttpUrlConnection`, and this is the reason for the bug. Okay, never mind. – Harald K Apr 21 '16 at 10:19
  • @haraldK I did read it, and I further found that it refers to chunked streaming mode as part of the solution, not part of the problem. – user207421 Apr 21 '16 at 10:23
  • @EJP, Malte You're right, the fix for the OOME is to enable chunked streaming (or fixed length). But it also describes it's not enabled by default due to the mentioned bug in the `HttpURLConnection`. Sorry, no link to the JRE bug. – Harald K Apr 21 '16 at 10:28
  • Also see the *first comment* on [this answer](http://stackoverflow.com/a/11176825/1428606), which seems to be from one of the Jersey committers. Its old, but maybe ask him directly for the bug link or description of the underlying problem? – Harald K Apr 21 '16 at 10:38

0 Answers0