gpt4 book ai didi

java - 发布请求和读取响应时读取超时/连接超时意味着什么 (Java 8)

转载 作者:太空宇宙 更新时间:2023-11-04 12:00:32 26 4
gpt4 key购买 nike

我正在开发与支付系统的集成,因此在某些情况下我需要了解发布请求和读取响应时读取超时的含义。

As per my understanding when we got read time out while posting request it means our request is not posted to the destination and we can assume request has been failed.

我只是想知道我的理解是否正确?

或者任何人都可以解释在发布请求时读取超时的可能性是什么。

Is that mean request not posted to destination, or it has been posted ?

public String postRequest(String request) throws Exception {
logger.info("Calling postRequest method in " +this.getClass().getName());
String responseData = null;
HttpURLConnection httpConn = null;
OutputStream out = null;
InputStreamReader isr = null;


bridgeUrl = new URL(StartupCache.getInstance().getConfigByKey(getUniqueKey(ConfigurationConstant.BRIDGE_URL))
.getConfigValue());

if (connectionTime == null) {
connectionTime = StartupCache.getInstance().getConfigByKey(getUniqueKey(ConfigurationConstant.CONNECTION_TIME_OUT));
if (connectionTime != null && connectionTime.getConfigValue().trim().length() > 0) {
connectionTimeOutInMilliSec = Integer.valueOf(connectionTime.getConfigValue());
}
}

try {
if (bridgeUrl.getProtocol().equalsIgnoreCase("https")) {
ignoreSslCertificateAuthentication();
httpConn = (HttpsURLConnection) bridgeUrl.openConnection();
} else {
httpConn = (HttpURLConnection) bridgeUrl.openConnection();
}
logger.info("\nRequest : "+request+"\n");


byte[] requestByte = request.getBytes();
httpConn.setRequestProperty("Content-Length", String.valueOf(requestByte.length));
httpConn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded" );
httpConn.setRequestMethod("POST");
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
httpConn.setConnectTimeout(connectionTimeOutInMilliSec);
httpConn.setReadTimeout(connectionTimeOutInMilliSec);
out = httpConn.getOutputStream();
out.write(requestByte);
logger.info("API Request sent at : " + sdf.format(new Date()));
out.close();
} catch (Exception e) {
logger.error(e.getMessage());
if (out != null) {
try {
logger.info("Closing output stream connection....");
out.close();
} catch (IOException ee) {
e.printStackTrace();
}
}
if (httpConn != null) {
logger.info("Closing httpConn in exception blcok of output stream connection....");
httpConn.disconnect();
}
throw new ApiRequestPostingException("Exception occured while posting : Reason : "+e.getMessage());
}
try {
// Read the response and write it to standard out.
isr = new InputStreamReader(httpConn.getInputStream());
logger.info("API Response received at : " + sdf.format(new Date())+" Response Code : "+httpConn.getResponseCode() );
BufferedReader br = new BufferedReader(isr);
String temp;
StringBuilder tmpResponseb = new StringBuilder();

while ((temp = br.readLine()) != null) {
tmpResponseb.append(temp);
}
responseData = tmpResponseb.toString();
logger.info("Response Data : " +responseData+"\n");
br.close();
isr.close();
} catch (java.net.MalformedURLException e) {
logger.error("Error in postRequest(): Secure Service Required");
e.printStackTrace();
} catch (Exception e) {
logger.error("Error in postRequest(): " + e.getMessage());
e.printStackTrace();
}finally {
if (isr != null) {
try {
logger.info("Closing input stream connection....");
isr.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (httpConn != null) {
logger.info("Disconnecting httpConn in reading finally block....");
httpConn.disconnect();
}
}
return responseData;
}

I have got connect timeout exception while posting request

        2016-12-04 18:00:41,814 ERROR [stderr] (default task-10) java.net.SocketTimeoutException: connect timed out
2016-12-04 18:00:41,815 ERROR [stderr] (default task-10) at java.net.PlainSocketImpl.socketConnect(Native Method)
2016-12-04 18:00:41,815 ERROR [stderr] (default task-10) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
2016-12-04 18:00:41,815 ERROR [stderr] (default task-10) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
2016-12-04 18:00:41,815 ERROR [stderr] (default task-10) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
2016-12-04 18:00:41,816 ERROR [stderr] (default task-10) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
2016-12-04 18:00:41,816 ERROR [stderr] (default task-10) at java.net.Socket.connect(Socket.java:589)
2016-12-04 18:00:41,816 ERROR [stderr] (default task-10) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668)
2016-12-04 18:00:41,816 ERROR [stderr] (default task-10) at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
2016-12-04 18:00:41,816 ERROR [stderr] (default task-10) at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
2016-12-04 18:00:41,817 ERROR [stderr] (default task-10) at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
2016-12-04 18:00:41,817 ERROR [stderr] (default task-10) at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
2016-12-04 18:00:41,817 ERROR [stderr] (default task-10) at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
2016-12-04 18:00:41,817 ERROR [stderr] (default task-10) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
2016-12-04 18:00:41,818 ERROR [stderr] (default task-10) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105)
2016-12-04 18:00:41,818 ERROR [stderr] (default task-10) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999)
2016-12-04 18:00:41,818 ERROR [stderr] (default task-10) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
2016-12-04 18:00:41,818 ERROR [stderr] (default task-10) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1283)
2016-12-04 18:00:41,818 ERROR [stderr] (default task-10) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1258)
2016-12-04 18:00:41,819 ERROR [stderr] (default task-10) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
2016-12-04 18:00:41,819 ERROR [stderr] (default task-10) at com.eko.axisweb.axiswebservice.service.AxisCommunicationService.postRequest(AxisCommunicationService.java:86)
2016-12-04 18:00:41,819 ERROR [stderr] (default task-10) at com.eko.axisweb.axiswebservice.service.TransactionService.postImpsP2ARequest(TransactionService.java:154)
2016-12-04 18:00:41,819 ERROR [stderr] (default task-10) at com.eko.axisweb.axiswebservice.service.AxisTransactionService.doImpsP2ARequest(AxisTransactionService.java:140)
2016-12-04 18:00:41,819 ERROR [stderr] (default task-10) at com.eko.axisweb.axiswebservice.resources.Transactions.impsP2ARequest(Transactions.java:97)
2016-12-04 18:00:41,820 ERROR [stderr] (default task-10) at sun.reflect.GeneratedMethodAccessor189.invoke(Unknown Source)
2016-12-04 18:00:41,820 ERROR [stderr] (default task-10) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2016-12-04 18:00:41,820 ERROR [stderr] (default task-10) at java.lang.reflect.Method.invoke(Method.java:498)
2016-12-04 18:00:41,820 ERROR [stderr] (default task-10) at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
2016-12-04 18:00:41,820 ERROR [stderr] (default task-10) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
2016-12-04 18:00:41,821 ERROR [stderr] (default task-10) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
2016-12-04 18:00:41,821 ERROR [stderr] (default task-10) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
2016-12-04 18:00:41,821 ERROR [stderr] (default task-10) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
2016-12-04 18:00:41,821 ERROR [stderr] (default task-10) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
2016-12-04 18:00:41,821 ERROR [stderr] (default task-10) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
2016-12-04 18:00:41,822 ERROR [stderr] (default task-10) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
2016-12-04 18:00:41,822 ERROR [stderr] (default task-10) at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:317)
2016-12-04 18:00:41,822 ERROR [stderr] (default task-10) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
2016-12-04 18:00:41,822 ERROR [stderr] (default task-10) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
2016-12-04 18:00:41,822 ERROR [stderr] (default task-10) at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
2016-12-04 18:00:41,823 ERROR [stderr] (default task-10) at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
2016-12-04 18:00:41,823 ERROR [stderr] (default task-10) at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
2016-12-04 18:00:41,823 ERROR [stderr] (default task-10) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
2016-12-04 18:00:41,823 ERROR [stderr] (default task-10) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:298)
2016-12-04 18:00:41,824 ERROR [stderr] (default task-10) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
2016-12-04 18:00:41,824 ERROR [stderr] (default task-10) at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:471)
2016-12-04 18:00:41,824 ERROR [stderr] (default task-10) at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:425)
2016-12-04 18:00:41,824 ERROR [stderr] (default task-10) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:383)
2016-12-04 18:00:41,824 ERROR [stderr] (default task-10) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:336)
2016-12-04 18:00:41,825 ERROR [stderr] (default task-10) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:223)
2016-12-04 18:00:41,825 ERROR [stderr] (default task-10) at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
2016-12-04 18:00:41,825 ERROR [stderr] (default task-10) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
2016-12-04 18:00:41,825 ERROR [stderr] (default task-10) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
2016-12-04 18:00:41,826 ERROR [stderr] (default task-10) at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
2016-12-04 18:00:41,826 ERROR [stderr] (default task-10) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
2016-12-04 18:00:41,826 ERROR [stderr] (default task-10) at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
2016-12-04 18:00:41,826 ERROR [stderr] (default task-10) at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
2016-12-04 18:00:41,826 ERROR [stderr] (default task-10) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
2016-12-04 18:00:41,827 ERROR [stderr] (default task-10) at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
2016-12-04 18:00:41,827 ERROR [stderr] (default task-10) at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
2016-12-04 18:00:41,827 ERROR [stderr] (default task-10) at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
2016-12-04 18:00:41,827 ERROR [stderr] (default task-10) at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
2016-12-04 18:00:41,827 ERROR [stderr] (default task-10) at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
2016-12-04 18:00:41,828 ERROR [stderr] (default task-10) at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
2016-12-04 18:00:41,828 ERROR [stderr] (default task-10) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
2016-12-04 18:00:41,828 ERROR [stderr] (default task-10) at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
2016-12-04 18:00:41,828 ERROR [stderr] (default task-10) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
2016-12-04 18:00:41,828 ERROR [stderr] (default task-10) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
2016-12-04 18:00:41,829 ERROR [stderr] (default task-10) at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)
2016-12-04 18:00:41,829 ERROR [stderr] (default task-10) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)
2016-12-04 18:00:41,829 ERROR [stderr] (default task-10) at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
2016-12-04 18:00:41,829 ERROR [stderr] (default task-10) at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)
2016-12-04 18:00:41,829 ERROR [stderr] (default task-10) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
2016-12-04 18:00:41,830 ERROR [stderr] (default task-10) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)
2016-12-04 18:00:41,830 ERROR [stderr] (default task-10) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
2016-12-04 18:00:41,830 ERROR [stderr] (default task-10) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
2016-12-04 18:00:41,830 ERROR [stderr] (default task-10) at java.lang.Thread.run(Thread.java:745)

Read Timeout while posting request

2016-12-04 18:07:51,438 ERROR [stderr] (default task-30) java.net.SocketTimeoutException: Read timed out
2016-12-04 18:07:51,439 ERROR [stderr] (default task-30) at java.net.SocketInputStream.socketRead0(Native Method)
2016-12-04 18:07:51,439 ERROR [stderr] (default task-30) at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
2016-12-04 18:07:51,439 ERROR [stderr] (default task-30) at java.net.SocketInputStream.read(SocketInputStream.java:170)
2016-12-04 18:07:51,439 ERROR [stderr] (default task-30) at java.net.SocketInputStream.read(SocketInputStream.java:141)
2016-12-04 18:07:51,439 ERROR [stderr] (default task-30) at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
2016-12-04 18:07:51,440 ERROR [stderr] (default task-30) at sun.security.ssl.InputRecord.read(InputRecord.java:503)
2016-12-04 18:07:51,440 ERROR [stderr] (default task-30) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
2016-12-04 18:07:51,440 ERROR [stderr] (default task-30) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
2016-12-04 18:07:51,440 ERROR [stderr] (default task-30) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
2016-12-04 18:07:51,440 ERROR [stderr] (default task-30) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
2016-12-04 18:07:51,441 ERROR [stderr] (default task-30) at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
2016-12-04 18:07:51,441 ERROR [stderr] (default task-30) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
2016-12-04 18:07:51,441 ERROR [stderr] (default task-30) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1283)
2016-12-04 18:07:51,441 ERROR [stderr] (default task-30) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1258)
2016-12-04 18:07:51,442 ERROR [stderr] (default task-30) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
2016-12-04 18:07:51,442 ERROR [stderr] (default task-30) at com.eko.axisweb.axiswebservice.service.AxisCommunicationService.postRequest(AxisCommunicationService.java:86)
2016-12-04 18:07:51,442 ERROR [stderr] (default task-30) at com.eko.axisweb.axiswebservice.service.TransactionService.postImpsP2ARequest(TransactionService.java:154)
2016-12-04 18:07:51,442 ERROR [stderr] (default task-30) at com.eko.axisweb.axiswebservice.service.AxisTransactionService.doImpsP2ARequest(AxisTransactionService.java:140)
2016-12-04 18:07:51,442 ERROR [stderr] (default task-30) at com.eko.axisweb.axiswebservice.resources.Transactions.impsP2ARequest(Transactions.java:97)
2016-12-04 18:07:51,443 ERROR [stderr] (default task-30) at sun.reflect.GeneratedMethodAccessor189.invoke(Unknown Source)
2016-12-04 18:07:51,443 ERROR [stderr] (default task-30) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2016-12-04 18:07:51,443 ERROR [stderr] (default task-30) at java.lang.reflect.Method.invoke(Method.java:498)
2016-12-04 18:07:51,443 ERROR [stderr] (default task-30) at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
2016-12-04 18:07:51,443 ERROR [stderr] (default task-30) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
2016-12-04 18:07:51,444 ERROR [stderr] (default task-30) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
2016-12-04 18:07:51,444 ERROR [stderr] (default task-30) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
2016-12-04 18:07:51,444 ERROR [stderr] (default task-30) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
2016-12-04 18:07:51,444 ERROR [stderr] (default task-30) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
2016-12-04 18:07:51,445 ERROR [stderr] (default task-30) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
2016-12-04 18:07:51,445 ERROR [stderr] (default task-30) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
2016-12-04 18:07:51,445 ERROR [stderr] (default task-30) at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:317)
2016-12-04 18:07:51,445 ERROR [stderr] (default task-30) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
2016-12-04 18:07:51,445 ERROR [stderr] (default task-30) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
2016-12-04 18:07:51,446 ERROR [stderr] (default task-30) at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
2016-12-04 18:07:51,446 ERROR [stderr] (default task-30) at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
2016-12-04 18:07:51,446 ERROR [stderr] (default task-30) at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
2016-12-04 18:07:51,446 ERROR [stderr] (default task-30) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
2016-12-04 18:07:51,446 ERROR [stderr] (default task-30) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:298)
2016-12-04 18:07:51,447 ERROR [stderr] (default task-30) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
2016-12-04 18:07:51,447 ERROR [stderr] (default task-30) at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:471)
2016-12-04 18:07:51,447 ERROR [stderr] (default task-30) at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:425)
2016-12-04 18:07:51,447 ERROR [stderr] (default task-30) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:383)
2016-12-04 18:07:51,448 ERROR [stderr] (default task-30) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:336)
2016-12-04 18:07:51,448 ERROR [stderr] (default task-30) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:223)
2016-12-04 18:07:51,448 ERROR [stderr] (default task-30) at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
2016-12-04 18:07:51,448 ERROR [stderr] (default task-30) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
2016-12-04 18:07:51,448 ERROR [stderr] (default task-30) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
2016-12-04 18:07:51,449 ERROR [stderr] (default task-30) at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
2016-12-04 18:07:51,449 ERROR [stderr] (default task-30) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
2016-12-04 18:07:51,449 ERROR [stderr] (default task-30) at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
2016-12-04 18:07:51,449 ERROR [stderr] (default task-30) at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
2016-12-04 18:07:51,449 ERROR [stderr] (default task-30) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
2016-12-04 18:07:51,450 ERROR [stderr] (default task-30) at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
2016-12-04 18:07:51,450 ERROR [stderr] (default task-30) at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
2016-12-04 18:07:51,450 ERROR [stderr] (default task-30) at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
2016-12-04 18:07:51,450 ERROR [stderr] (default task-30) at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
2016-12-04 18:07:51,451 ERROR [stderr] (default task-30) at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
2016-12-04 18:07:51,451 ERROR [stderr] (default task-30) at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
2016-12-04 18:07:51,451 ERROR [stderr] (default task-30) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
2016-12-04 18:07:51,451 ERROR [stderr] (default task-30) at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
2016-12-04 18:07:51,451 ERROR [stderr] (default task-30) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
2016-12-04 18:07:51,452 ERROR [stderr] (default task-30) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
2016-12-04 18:07:51,452 ERROR [stderr] (default task-30) at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)
2016-12-04 18:07:51,452 ERROR [stderr] (default task-30) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)
2016-12-04 18:07:51,452 ERROR [stderr] (default task-30) at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
2016-12-04 18:07:51,452 ERROR [stderr] (default task-30) at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)
2016-12-04 18:07:51,453 ERROR [stderr] (default task-30) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
2016-12-04 18:07:51,453 ERROR [stderr] (default task-30) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)
2016-12-04 18:07:51,453 ERROR [stderr] (default task-30) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
2016-12-04 18:07:51,453 ERROR [stderr] (default task-30) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
2016-12-04 18:07:51,454 ERROR [stderr] (default task-30) at java.lang.Thread.run(Thread.java:745)

最佳答案

As per my understanding when we got read time out while posting request it means our request is not posted to the destination and we can assume request has been failed.

这个假设是不正确的。读取超时和连接超时是不同的事情:

读取超时 - 请求已发布并可能已处理,但未及时收到响应。因此,您不知道在异常发生时请求发生了什么。

连接超时 - 请求失败。

关于java - 发布请求和读取响应时读取超时/连接超时意味着什么 (Java 8),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40957613/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com