org.springframework.web.client.ResourceAccessException: I/O error on POST request for "xxxx": Software caused connection abort: socket write error; nested exception is
org.springframework.web.client.ResourceAccessException: I/O error on POST request for "https://appmaster-ui-rootcloud-platform-pre.rxx.com/je/nxgx-base/nxJcdaDeviceType/selectAll": Software caused connection abort: socket write error; nested exception is java.net.SocketException: Software caused connection abort: socket write error
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:785)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711)
at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:437)
at com.rootcloud.ezd.controller.DeviceProductController.listProductType(DeviceProductController.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1070)
搞了好久,一 天,没有弄好,各种尝试,无法请求到测试服务器。但是旁边同事是可以的,我用浏览器直接请求也是可以的。
用浏览器可以正常请求,我用程序就不行,好像每天第一次可以访问,可以通过。
var url = "https://appmaster-ui-rootcloud-platform-pre.xx.com/je/nxgx-base/nxJcxxSblb/selectByCondition";
var params = {
};
var xhr = new XMLHttpRequest();
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.onload = function (e) {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
console.log(xhr.responseText);
} else {
console.error(xhr.statusText);
}
}
};
xhr.onerror = function (e) {
console.error(xhr.statusText);
};
xhr.send(JSON.stringify(params));
然后同事说可以搞定,一杯奶茶,神奇呀。
然后他打开我电脑上赛门铁克软件,关闭相应的网络防护,然后就可以正常请求了。
浙公网安备 33010602011771号