Java ResourceAccessException:I/O错误:获取时超时:RestTemplate
我在Spring3.0中遇到了RestTemplate的问题。 当我试图请求谷歌应用程序引擎应用程序中的其他应用程序时,超时时间为5秒 我的客户端应用程序和服务器应用程序都在Google App Engine中 以下是客户端代码:Java ResourceAccessException:I/O错误:获取时超时:RestTemplate,java,android,spring-3,Java,Android,Spring 3,我在Spring3.0中遇到了RestTemplate的问题。 当我试图请求谷歌应用程序引擎应用程序中的其他应用程序时,超时时间为5秒 我的客户端应用程序和服务器应用程序都在Google App Engine中 以下是客户端代码: RestTemplate restTemplate = new RestTemplate(); restTemplate.postForObject( pUrl , paramObj , String.class ) 例外情况: org.springfra
RestTemplate restTemplate = new RestTemplate();
restTemplate.postForObject( pUrl , paramObj , String.class )
例外情况:
org.springframework.web.client.ResourceAccessException: I/O error:
Timeout while fetching: http://naresh-app.appspot.com/HistoryAction/getHistory.json;
nested exception is java.net.SocketTimeoutException:
Timeout while fetching: http://naresh-app.appspot.com/HistoryAction/getHistory.json
网络连接好吗?我认为您以后只能处理异常和恢复。您是否将套接字超时设置为非常低的值?它已修复,这是Rest api的一个问题,更新后工作正常:)