Apache ConnectionClosedException: Connection closed,HttpAsyncRequestExecutor.endOfInput(HttpAsyncRequestExecutor.java:344) - java

we have three applications A,B and C deployed on same tomcat server.There is an HTTP call that happens between A to B(REST CALL) and Another http call from B to C(REST CALL)
We were using synchronous HTTP call initially,recently we changed our code to Asynchronous call.
We have used HttpAsyncClients for (Application A to call Application B)
and for (Application B to call Application C)..
we are getting intermittent org.apache.http.ConnectionClosedException:
Some time we are getting this exception in Logs of application A(Async Client to B) and some time in Application B(Async Client to C)
CloseableHttpAsyncClient client = HttpAsyncClients.custom()
.setMaxConnPerRoute(100))
.setMaxConnTotal(config.getInt(150)).build();
and for Every request we gave timeout of
final RequestConfig params = RequestConfig.custom().setConnectTimeout(300000) // 5min
.setSocketTimeout(300000).setConnectionRequestTimeout(300000).build();
Please find the stack trace below:
org.apache.http.ConnectionClosedException: Connection closed
at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.endOfInput(HttpAsyncRequestExecutor.java:344) [httpcore-nio-4.4.5.jar:4.4.5]
at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:261) [httpcore-nio-4.4.5.jar:na]
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81) [httpasyncclient-4.1.2.jar:na]
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39) [httpasyncclient-4.1.2.jar:na]
at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:114) [httpcore-nio-4.4.5.jar:4.4.5]
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162) [httpcore-nio-4.4.5.jar:4.4.5]
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337) [httpcore-nio-4.4.5.jar:4.4.5]
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315) [httpcore-nio-4.4.5.jar:4.4.5]
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276) [httpcore-nio-4.4.5.jar:4.4.5]
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104) [httpcore-nio-4.4.5.jar:4.4.5]
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588) [httpcore-nio-4.4.5.jar:4.4.5]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
Please Note this question is not duplicate of
Intermittent ConnectionClosedException with httpasynclient stacj trace is completely different..And event this issue happens intermittent.

Related

CXF cannot set ExceptionHandler for DefaultConnectingIOReactor

I use cxf with default clients for my async http requests. In some cases, connectingIOReactor gets some RuntimeException and breaks the reactor.
org.apache.http.nio.reactor.IOReactorException: I/O dispatch worker terminated abnormally
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:359)
at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221)
at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: HostnameVerifier, socket reset for TTL
2 lines skipped for [org.apache.cxf]
at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy$1.verify(SSLIOSessionStrategy.java:188)
at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:371)
at org.apache.http.nio.reactor.ssl.SSLIOSession.isAppInputReady(SSLIOSession.java:541)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:120)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:591)
... 1 more
Whenever IOReactor throws exception, I always get message Request cannot be executed; I/O reactor status: STOPPED. I cannot send requests again till application is restarted.
I solved my problem by copying AsyncHTTPConduitFactory and set exceptionHandler for ioreactor manuelly. However, I couldn't find any way to set this exception handler via properties or without copying.
Is there any way to set exceptionHandler parameterized way?

Connection closed when calling fcm.googleapis.com/fcm/send

I am sending notification pushes to browsers from my Java backend server and recently I've been getting a lot of Connections Closed exceptions. I use Java Web Push library.
This issue started around December 23, 2020 (not a significant date from my perspective, but perhaps there was some update that I'm not aware of...)
Here is a sample stacktrace, I'm hoping that I can get some ideas of how to tackle this issue. As far as I understand, if the registration is invalid or expired, I would still receive an HTTP status code that I can react to. A connection closed is unexpected and I do not know whether the records I have is valid or not.
I think it is unlikely that the error has to do with the Web Push library. Any help would be greatly appreciated. Thanks.
java.util.concurrent.ExecutionException: org.apache.http.ConnectionClosedException: Connection closed
at org.apache.http.concurrent.BasicFuture.getResult(BasicFuture.java:71)
at org.apache.http.concurrent.BasicFuture.get(BasicFuture.java:84)
at org.apache.http.impl.nio.client.FutureWrapper.get(FutureWrapper.java:70)
at nl.martijndwars.webpush.PushService.send(PushService.java:118)
at my.package.MyClass.sendNotification(MyClass.java:xx)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.http.ConnectionClosedException: Connection closed
at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.endOfInput(HttpAsyncRequestExecutor.java:347)
at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:261)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:121)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
... 1 more
Caused by:
org.apache.http.ConnectionClosedException: Connection closed
at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.endOfInput(HttpAsyncRequestExecutor.java:347)
at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:261)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:121)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
at java.lang.Thread.run(Thread.java:748)

ElasticSearch - RestHighLevelClient java.io.IOException: An existing connection was forcibly closed by the remote host

Am fetch 100K plus documents from an Index using single query. For that am using ScrollSearch API. After that am iterating each and every doucments one by one and adding one more field into that and creating a new index for that.
Am using RestHighLevelClient for the connectivity between Java Code and ElasticSearch. I have set Timeout options for 25 hours (setMaxRetryTimeoutMillis(90000000)).
But, still am getting the below exception after 30 minutes
Exception in thread "main" java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(Unknown Source)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.read(Unknown Source)
at sun.nio.ch.SocketChannelImpl.read(Unknown Source)
at org.apache.http.impl.nio.reactor.SessionInputBufferImpl.fill(SessionInputBufferImpl.java:204)
at org.apache.http.impl.nio.codecs.AbstractMessageParser.fillBuffer(AbstractMessageParser.java:136)
at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:241)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:114)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
at java.lang.Thread.run(Unknown Source)
My ElasticSearch server is running on remote machine. Once i got this exception, my remote machine ES server also get shutdown automatically.
Please find the code below, where i creating instance for RestHighLevelClient.
private static RestClientBuilder builder = RestClient.builder(new HttpHost("My_Server.com", 9200, "http"),
new HttpHost("My_Server.com", 9201, "http"))
.setRequestConfigCallback(new RestClientBuilder.RequestConfigCallback() {
#Override
public RequestConfig.Builder customizeRequestConfig(RequestConfig.Builder requestConfigBuilder) {
return requestConfigBuilder.setConnectTimeout(90000000)//25hours
.setSocketTimeout(90000000);
}
})
.setMaxRetryTimeoutMillis(90000000);
private static RestHighLevelClient instance4 = new RestHighLevelClient(builder);
public static RestHighLevelClient getInstance3() {
return instance4;
}

HTTP request failing with EOFException

Using Jetty 9.4.10.v20180503, occasionally my HTTP client fails with the following error.
java.io.EOFException: HttpConnectionOverHTTP#571103e6(l:/192.168.1.100:27497 <-> r:api.kucoin.com/13.113.121.24:443,closed=false)=>HttpChannelOverHTTP#a423e61(exchange=HttpExchange#e7dbbf1 req=TERMINATED/null#null res=PENDING/null#null)[send=HttpSenderOverHTTP#4b7f345a(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator#61d4e46c{s=START}],recv=HttpReceiverOverHTTP#7a7e7f01(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]<-DecryptedEndPoint#193ff18c{api.kucoin.com/13.113.121.24:443<->/192.168.1.100:27497,OPEN,fill=-,flush=-,to=22604/0}->HttpConnectionOverHTTP#571103e6(l:/192.168.1.100:27497 <-> r:api.kucoin.com/13.113.121.24:443,closed=false)=>HttpChannelOverHTTP#a423e61(exchange=HttpExchange#e7dbbf1 req=TERMINATED/null#null res=PENDING/null#null)[send=HttpSenderOverHTTP#4b7f345a(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator#61d4e46c{s=START}],recv=HttpReceiverOverHTTP#7a7e7f01(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]->SocketChannelEndPoint#2b50cb15{api.kucoin.com/13.113.121.24:443<->/192.168.1.100:27497,ISHUT,fill=-,flush=-,to=21603/0}{io=0/0,kio=0,kro=1}->SslConnection#6de1ad97{NEED_WRAP,eio=-1/-1,di=-1}=>HttpConnectionOverHTTP#571103e6(l:/192.168.1.100:27497 <-> r:api.kucoin.com/13.113.121.24:443,closed=false)=>HttpChannelOverHTTP#a423e61(exchange=HttpExchange#e7dbbf1 req=TERMINATED/null#null res=PENDING/null#null)[send=HttpSenderOverHTTP#4b7f345a(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator#61d4e46c{s=START}],recv=HttpReceiverOverHTTP#7a7e7f01(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]
at java.util.concurrent.CompletableFuture.encodeRelay(CompletableFuture.java:326)
at java.util.concurrent.CompletableFuture.completeRelay(CompletableFuture.java:338)
at java.util.concurrent.CompletableFuture.uniRelay(CompletableFuture.java:911)
at java.util.concurrent.CompletableFuture$UniRelay.tryFire(CompletableFuture.java:899)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)
at com.myapplication.ResponseListener.onComplete(ResponseListener.java:45)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:193)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:185)
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:464)
at org.eclipse.jetty.client.HttpReceiver.abort(HttpReceiver.java:545)
at org.eclipse.jetty.client.HttpReceiver.responseFailure(HttpReceiver.java:436)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.failAndClose(HttpReceiverOverHTTP.java:369)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.earlyEOF(HttpReceiverOverHTTP.java:338)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1476)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.shutdown(HttpReceiverOverHTTP.java:209)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:147)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:73)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:133)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:155)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:291)
at org.eclipse.jetty.io.ssl.SslConnection$3.succeeded(SslConnection.java:151)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:760)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:678)
... 1 common frames omitted
Caused by: java.io.EOFException: HttpConnectionOverHTTP#571103e6(l:/192.168.1.100:27497 <-> r:api.kucoin.com/13.113.121.24:443,closed=false)=>HttpChannelOverHTTP#a423e61(exchange=HttpExchange#e7dbbf1 req=TERMINATED/null#null res=PENDING/null#null)[send=HttpSenderOverHTTP#4b7f345a(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator#61d4e46c{s=START}],recv=HttpReceiverOverHTTP#7a7e7f01(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]<-DecryptedEndPoint#193ff18c{api.kucoin.com/13.113.121.24:443<->/192.168.1.100:27497,OPEN,fill=-,flush=-,to=22604/0}->HttpConnectionOverHTTP#571103e6(l:/192.168.1.100:27497 <-> r:api.kucoin.com/13.113.121.24:443,closed=false)=>HttpChannelOverHTTP#a423e61(exchange=HttpExchange#e7dbbf1 req=TERMINATED/null#null res=PENDING/null#null)[send=HttpSenderOverHTTP#4b7f345a(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator#61d4e46c{s=START}],recv=HttpReceiverOverHTTP#7a7e7f01(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]->SocketChannelEndPoint#2b50cb15{api.kucoin.com/13.113.121.24:443<->/192.168.1.100:27497,ISHUT,fill=-,flush=-,to=21603/0}{io=0/0,kio=0,kro=1}->SslConnection#6de1ad97{NEED_WRAP,eio=-1/-1,di=-1}=>HttpConnectionOverHTTP#571103e6(l:/192.168.1.100:27497 <-> r:api.kucoin.com/13.113.121.24:443,closed=false)=>HttpChannelOverHTTP#a423e61(exchange=HttpExchange#e7dbbf1 req=TERMINATED/null#null res=PENDING/null#null)[send=HttpSenderOverHTTP#4b7f345a(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator#61d4e46c{s=START}],recv=HttpReceiverOverHTTP#7a7e7f01(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]
I'm trying to understand how to interpret this error, specifically the EOFException which seems to list the steps of the transaction.
What is happening at each step?
At what step of the HTTP request does the error occur?
Did the client trigger a disconnect or the server?
Is it safe to automatically retry these kind of failures?

java.nio.channels.ClosedChannelException -Client shuts down SSL

HI,
I have a webservice running on glassfish3.1 server on one machine.
On second machine I have a java (GUI) app, that is running and calls the above mentioned web service.
In my webservice call, i send a file as SOAP attachment. It reaches the server, the file is then processed and then it is returned back to my client machine over https.
If my file is too large and takes more than 15 mins, the operation fails and I get the following error:
On Client side:
Couldn't create SOAP message due to exception: org.jvnet.mimepull.MIMEParsingException: javax.net.ssl.SSLException: SSL peer shut down incorrectly
on server side:
javax.servlet.ServletException
at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:150)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.xml.ws.WebServiceException: com.ctc.wstx.exc.WstxIOException: java.nio.channels.ClosedChannelException
at com.sun.xml.ws.encoding.MtomCodec.encode(MtomCodec.java:184)
at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:282)
at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.java:400)
at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java:96)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:618)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:259)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:162)
at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:145)
... 27 more
Caused by: com.ctc.wstx.exc.WstxIOException: java.nio.channels.ClosedChannelException
at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:313)
at com.sun.xml.ws.util.xml.XMLStreamWriterFilter.flush(XMLStreamWriterFilter.java:71)
at com.sun.xml.ws.streaming.XMLStreamWriterUtil.getOutputStream(XMLStreamWriterUtil.java:101)
at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:320)
at com.sun.xml.ws.message.AbstractMessageImpl.writeTo(AbstractMessageImpl.java:147)
at com.sun.xml.ws.encoding.MtomCodec.encode(MtomCodec.java:168)
... 34 more
Caused by: org.apache.catalina.connector.ClientAbortException: java.nio.channels.ClosedChannelException
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:382)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:351)
at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:175)
at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:99)
at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:214)
at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:311)
... 39 more
Caused by: java.nio.channels.ClosedChannelException
at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:133)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:324)
at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:108)
at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:76)
at com.sun.grizzly.util.SSLOutputWriter.flushChannel(SSLOutputWriter.java:102)
at com.sun.grizzly.ssl.SSLOutputBuffer.flushChannel(SSLOutputBuffer.java:138)
at com.sun.grizzly.http.SocketChannelOutputBuffer.flushBuffer(SocketChannelOutputBuffer.java:398)
at com.sun.grizzly.http.SocketChannelOutputBuffer.flush(SocketChannelOutputBuffer.java:376)
at com.sun.grizzly.http.ProcessorTask.action(ProcessorTask.java:1241)
at com.sun.grizzly.ssl.SSLProcessorTask.action(SSLProcessorTask.java:164)
at com.sun.grizzly.tcp.Response.action(Response.java:268)
at org.apache.catalina.connector.OutputBuffer.doFlush(Output
...
I think that SSL session is timed out on my client side and not on the server side.
Now I am trying to figure out a way to increase the SSL timeout on my client side which i suppose is 15 mins...
I am not able to do so, any help would be appriciated...
Thank you
I think that SSL session is timed out
on my client side
No. Your client encountered a closed (reset) connection without first receiving an SSL close_notify from the server. So it wasn't the client. I would guess that the server is imposing a POST size limit and closing the connection when you exceed it.
If you are sending too much data you are going to experience IOExceptions somewhere or other. Either obey the limit or raise it, and obey the new value.
Open your domain.xml and try to find out which SSL version you are using.
If you see something like the following one[ ssl3-enabled="false" ], then it's SSL2 which has default timeout of 100 seconds.
<ssl classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" ssl3-enabled="false" cert-nickname="s1as"></ssl>
In such a scenario
either you can put some bigger value to ssl-session-timeout property[you may need to add this]
or you may opt for using ssl3 over ssl which has larger value for timeout by default.
Ref: http://download.oracle.com/docs/cd/E19798-01/821-1753/abhaq/index.html

Categories