Hide Forgot
Description of problem: DataSourceProvider that comes with RESTeasy is using the method InputStream::available method, which shouldn't be used as it is mention on InputStream's Javadoc[1]: " Note that while some implementations of InputStream will return the total number of bytes in the stream, many will not. It is never correct to use the return value of this method to allocate a buffer intended to hold all data in this stream." Customers have mention that they are experiencing issues when using this provider [1] http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html#available%28%29 The solution would be avoid the usage of InputStream::available method.
Kyle Lape <kyle.lape> updated the status of jira RESTEASY-779 to Resolved
Changed from Bug Fix to Known Issue to fix Bug 1097118.
Patch applied: master:resteasy-prod weinanli$ git branch 2.3.7.1.Final-redhat 2.3.7.2.Final-redhat 2.3.7.Final-redhat 2.3.7.Final-redhat-2 2.3.7.Final-redhat-2-BZ1091552 2.3.8.Final-redhat * 2.3.8.SP1-redhat-1 master master:resteasy-prod weinanli$ git status On branch 2.3.8.SP1-redhat-1 Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: jaxrs-api/src/main/java/javax/ws/rs/core/NoContentException.java new file: resteasy-jaxrs/src/main/java/org/jboss/resteasy/util/NoContent.java new file: resteasy-jaxrs/src/main/java/org/jboss/resteasy/util/NoContentInputStreamDelegate.java Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/providers/DataSourceProvider.java Patch borrowed from upstream: https://github.com/resteasy/Resteasy/pull/497/files ### NOTE ### Please note we need to add a new class in 'jaxrs-api' from JAX-RS 2.0 spec: NoContentException.java As EAP6 doesn't use the 'jaxrs-api' inside RESTEasy and build a standalone spec jar: master:jboss-eap-6.3 weinanli$ find . | grep jaxrs-api ./modules/system/layers/base/javax/ws/rs/api/main/jboss-jaxrs-api_1.1_spec-1.0.1.Final-redhat-2.jar It needs to be added into that jar for this patch to work. Or resteasy will fail to work on EAP6.
Blocked by BZ1119409. Mark, please decide whether we can put this in EAP 6.3.1 or not. If as Fernando said the jax-rs spec 1.1 can't be modified, then we should defer this issue to RESTEasy 3.x + EAP7.
Verified in 6.3.1.CP.CR1. Reproduced with org.jboss.resteasy.plugins.providers.DataSourceProviderTest.
Alessio Soldano <asoldano> updated the status of jira RESTEASY-779 to Closed