Computing Magazine

Jersey Rest Service : Stream Already Closed Error

Posted on the 13 September 2013 by Abhishek Somani @somaniabhi
Creating File Upload functionality in WebServices using Jersey is very simple , you can go through this post to create file upload functionality in Jersey Rest Service. However , you may get an exception like this , if you are using Buffered Reader to read the uploaded file stream.
 java.lang.IllegalStateException: Stream already closed
 at org.jvnet.mimepull.DataHead$ReadMultiStream.fetch(
 at org.jvnet.mimepull.DataHead$
 at sun.nio.cs.StreamDecoder.readBytes(
 at sun.nio.cs.StreamDecoder.implRead(

This is a known issue in mimepull version 1.6 , which we are using along with jersey multi part jar . Try using mimepull version 1.9 and you will not see this error any more . Post Comments and Suggestions !! Jersey Rest Service : Stream Already Closed Error

Back to Featured Articles on Logo Paperblog