我正在使用tomcat和docker容器内部运行我的应用程序。一切正常,但有时我得到SocketTimeoutException访问一些网址时读取超时。
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137)
at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153)
at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:282)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:165)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at com.gauss.forms.ui.util.DocumentSetUtil.postDocumentSet(DocumentSetUtil.java:595)
at com.gauss.forms.ui.util.DocumentSetUtil.notifyDocumentSet_POST(DocumentSetUtil.java:518)
at com.gauss.forms.action.type.util.ActionTypeUtil.doTheDocActionPost(ActionTypeUtil.java:990)
at com.gauss.forms.action.type.util.ActionTypeUtil.resolveUrlAndDoTheDocActionPost(ActionTypeUtil.java:956)
at com.gauss.forms.action.type.util.ActionTypeUtil.doDocAction(ActionTypeUtil.java:812)
at com.gauss.forms.web.FormResource$2.handle(FormResource.java:991)
at com.gauss.forms.core.Handler.doHandle(Handler.java:31)
at com.gauss.forms.core.TransactedHandler.access$001(TransactedHandler.java:20)
at com.gauss.forms.core.TransactedHandler$1.doInTransactionWithoutResult(TransactedHandler.java:29)
at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at com.gauss.forms.core.TransactedHandler.doHandle(TransactedHandler.java:25)
at com.gauss.forms.core.Resource.doHandle(Resource.java:67)
at com.gauss.forms.web.FormResource.doHandle(FormResource.java:1221)
at com.gauss.forms.core.Resource.handle(Resource.java:55)
at com.gauss.forms.core.Filter.handle(Filter.java:61)
at com.gauss.forms.web.XHTMLCacheFilter.handle(XHTMLCacheFilter.java:196)
我正在使用ubuntu 16.04使用网桥创建docker容器。 docker机器在EC2上运行。 注意:我尝试增加connectionTimeout,但这也没有帮助。