javax.ws.rs.ProcessingException: Error closing message content input stream.

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • {code} javax.ws.rs.ProcessingException: Error closing message content input stream. at org.glassfish.jersey.message.internal.EntityInputStream.close(EntityInputStream.java:159) at sun.nio.cs.StreamDecoder.implClose(StreamDecoder.java:358) at sun.nio.cs.StreamDecoder.close(StreamDecoder.java:173) at java.io.InputStreamReader.close(InputStreamReader.java:182) at org.eclipse.persistence.internal.libraries.antlr.runtime.ANTLRReaderStream.load(ANTLRReaderStream.java:92) at org.eclipse.persistence.internal.libraries.antlr.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:68) at org.eclipse.persistence.internal.libraries.antlr.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:52) at org.eclipse.persistence.internal.libraries.antlr.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:48) at org.eclipse.persistence.internal.libraries.antlr.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:40) at org.eclipse.persistence.internal.oxm.record.json.JSONReader.parse(JSONReader.java:105) at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:972) at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:425) at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:375) at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:705) at org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:655) at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:301) at org.eclipse.persistence.jaxb.rs.MOXyJsonProvider.readFrom(MOXyJsonProvider.java:580) at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.invokeReadFrom(ReaderInterceptorExecutor.java:239) at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:211) at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:139) at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:1109) at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:853) at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:785) at org.glassfish.jersey.client.ClientResponse.readEntity(ClientResponse.java:267) at org.glassfish.jersey.client.InboundJaxrsResponse$1.call(InboundJaxrsResponse.java:111) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:228) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:397) at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:108) at com.xxxxx.GalaxyFDSClient.listObjects(GalaxyFDSClient.java:334) at com.xxxxx.TestFDSJavaSdk.deleteOneBucket(TestFDSJavaSdk.java:172) at com.xxxxx.TestFDSJavaSdk.testListBuckets(TestFDSJavaSdk.java:401) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74) Caused by: java.io.IOException: Stream closed. at java.net.PlainSocketImpl.available(PlainSocketImpl.java:452) at java.net.SocketInputStream.available(SocketInputStream.java:217) at java.io.BufferedInputStream.available(BufferedInputStream.java:381) at sun.net.www.MeteredStream.available(MeteredStream.java:152) at sun.net.www.http.KeepAliveStream.close(KeepAliveStream.java:72) at java.io.FilterInputStream.close(FilterInputStream.java:155) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(HttpURLConnection.java:2739) at org.glassfish.jersey.client.HttpUrlConnector$1.close(HttpUrlConnector.java:151) at org.glassfish.jersey.message.internal.EntityInputStream.close(EntityInputStream.java:157) ... 41 more {code}
    via by wuzesheng,
  • Erro : java.io.IOException: Stream closed
    via Stack Overflow by MagicConch
    ,
  • We have an application that we have run for a while now off of Java 6. It use the jersey client to make call to RESTful services running on, now, a Glassfish 3.1.2 server. This application and the following code work GREAT on Java 6 (either javaw.exe or javaws.exe) but it only runs successfully on Java 7 for javaw.exe - Java Web Start (javaws.exe) throws the following exception, BUT ONLY when the response is "Transfer-Encoding: chunked" (which MOST of our services are coming back as - this was verified though a REST Client Test program) ## Here is the Exception and a Trace leading to the exception... MYDEBUG GET https://server/rest/resources/order/ORDERNUM network: Cache entry not found [url: https://server/rest/resources/order/ORDERNUM, version: null] network: Connecting https://server/rest/resources/order/ORDERNUM with proxy=DIRECT network: Connecting socket://server:443 with proxy=DIRECT network: Connecting https://server/rest/resources/order/ORDERNUM with cookie "__utma=180075764.1583854260.1317325251.1319570927.1321634163.4" preloader: Stop progressCheck thread network: CleanupThread used 3 us network: Downloading resource: https://server/rest/resources/order/ORDERNUM Content-Length: -1 Content-Encoding: null network: Wrote URL https://server/rest/resources/order/ORDERNUM to File %AppData%\LocalLow\Sun\Java\Deployment\cache\6.0\33\7d32c9a1-5e978903-temp network: CleanupThread used 2 us java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.javaws.Launcher.executeApplication(Unknown Source) at com.sun.javaws.Launcher.executeMainClass(Unknown Source) at com.sun.javaws.Launcher.doLaunchApp(Unknown Source) at com.sun.javaws.Launcher.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: com.sun.jersey.api.client.ClientHandlerException: java.io.IOException: stream is closed at com.sun.jersey.api.client.ClientResponse.close(ClientResponse.java:615) at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:570) at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:535) at com.sun.jersey.api.client.WebResource.handle(WebResource.java:696) at com.sun.jersey.api.client.WebResource.access$300(WebResource.java:74) at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:512) at client.AbstractClient.getList(AbstractClient.java:65) at client.OE.FactoryOrderClient.getOpenFactoryOrders(FactoryOrderClient.java:50) at gui.TestClient.main(TestClient.java:42) ... 9 more Caused by: java.io.IOException: stream is closed at sun.net.www.http.ChunkedInputStream.ensureOpen(Unknown Source) at sun.net.www.http.ChunkedInputStream.read(Unknown Source) at java.io.FilterInputStream.read(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(Unknown Source) at com.sun.jersey.api.client.ClientResponse.close(ClientResponse.java:613) ... 17 more ## ## This application uses the following code to get at XML services: //-Create Client for SSL access ClientConfig config = new DefaultClientConfig(); // SSL configuration config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, new HTTPSProperties(getHostnameVerifier(), getSSLContext())); Client client = Client.create(config); //-Get Web Resource WebResource resource = client.resource(BASE_URI).path(path); //process query parms resource = resource.queryParam(e.getKey(), e.getValue()); //Get the RESTful Object try { object = resource.accept(mediaType).get(c); //!!!THE IO EXCEPTION IS THROWN HERE!!! } catch (UniformInterfaceException e) { ClientResponse response = e.getResponse(); //-Process Response as needed... } ## I do not understand why this application runs fine from Java 7 when packaged and run using javaw.exe but fails when run from Java Web Start (javaws.exe) It fails the same way everytime unless the service doesn't "chunk" the Transfer-Encoding. Please let me know if there is anything that could be causing this problem. Thanks! Daryl
    via by creation_49221,
    • javax.ws.rs.ProcessingException: Error closing message content input stream. at org.glassfish.jersey.message.internal.EntityInputStream.close(EntityInputStream.java:159) at sun.nio.cs.StreamDecoder.implClose(StreamDecoder.java:358) at sun.nio.cs.StreamDecoder.close(StreamDecoder.java:173) at java.io.InputStreamReader.close(InputStreamReader.java:182) at org.eclipse.persistence.internal.libraries.antlr.runtime.ANTLRReaderStream.load(ANTLRReaderStream.java:92) at org.eclipse.persistence.internal.libraries.antlr.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:68) at org.eclipse.persistence.internal.libraries.antlr.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:52) at org.eclipse.persistence.internal.libraries.antlr.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:48) at org.eclipse.persistence.internal.libraries.antlr.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:40) at org.eclipse.persistence.internal.oxm.record.json.JSONReader.parse(JSONReader.java:105) at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:972) at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:425) at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:375) at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:705) at org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:655) at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:301) at org.eclipse.persistence.jaxb.rs.MOXyJsonProvider.readFrom(MOXyJsonProvider.java:580) at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.invokeReadFrom(ReaderInterceptorExecutor.java:239) at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:211) at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:139) at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:1109) at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:853) at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:785) at org.glassfish.jersey.client.ClientResponse.readEntity(ClientResponse.java:267) at org.glassfish.jersey.client.InboundJaxrsResponse$1.call(InboundJaxrsResponse.java:111) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:228) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:397) at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:108) at com.xxxxx.GalaxyFDSClient.listObjects(GalaxyFDSClient.java:334) at com.xxxxx.TestFDSJavaSdk.deleteOneBucket(TestFDSJavaSdk.java:172) at com.xxxxx.TestFDSJavaSdk.testListBuckets(TestFDSJavaSdk.java:401) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74) Caused by: java.io.IOException: Stream closed. at java.net.PlainSocketImpl.available(PlainSocketImpl.java:452) at java.net.SocketInputStream.available(SocketInputStream.java:217) at java.io.BufferedInputStream.available(BufferedInputStream.java:381) at sun.net.www.MeteredStream.available(MeteredStream.java:152) at sun.net.www.http.KeepAliveStream.close(KeepAliveStream.java:72) at java.io.FilterInputStream.close(FilterInputStream.java:155) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(HttpURLConnection.java:2739) at org.glassfish.jersey.client.HttpUrlConnector$1.close(HttpUrlConnector.java:151) at org.glassfish.jersey.message.internal.EntityInputStream.close(EntityInputStream.java:157) ... 41 more

    Users with the same issue

    Unknown visitor1 times, last one,