org.springframework.web.client.ResourceAccessException: I/O error: Timeout while fetching: https://graph.facebook.com/me; nested exception is java.net.SocketTimeoutException: Timeout while fetching: https://graph.facebook.com/me

Spring JIRA | Scott Murphy | 5 years ago
  1. 0

    This is a major problem on Google App Engine. I am periodically getting exceptions using twitter and facebook. I need to be able to change the default timeout on a request from 5 (default) to 10 seconds. http://code.google.com/appengine/docs/java/urlfetch/overview.html "You can set a deadline for a request, the most amount of time the service will wait for a response. By default, the deadline for a fetch is 5 seconds. The maximum deadline is 10 seconds for online requests and 10 minutes for offline requests. When using the URLConnection interface, the service uses the connection timeout (setConnectTimeout()) plus the read timeout (setReadTimeout()) as the deadline." The solution would be to extend SimpleClientHttpRequestFactory, but there doesn't appear to be a simple way to inject it. Perhaps allowing the user to provide their own ClientHttpRequestFactorySelector as a Spring bean might be a solution? This is what I need: {code} public class GAESimpleClientHttpRequestFactory extends SimpleClientHttpRequestFactory { @Override protected void prepareConnection(HttpURLConnection connection, String httpMethod) throws IOException { connection.setConnectTimeout(10); connection.setReadTimeout(10); super.prepareConnection(connection, httpMethod); } } {code} This is the pain I am experiencing: Twitter: {code} Caused by: org.springframework.web.client.ResourceAccessException: I/O error: Timeout while fetching: https://api.twitter.com/1/account/verify_credentials.json; nested exception is java.net.SocketTimeoutException: Timeout while fetching: https://api.twitter.com/1/account/verify_credentials.json at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:453) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:415) at org.springframework.web.client.RestTemplate.getForObject(RestTemplate. java:213) at org.springframework.social.twitter.api.impl.UserTemplate.getUserProfile(UserTemplate.java:54) at org.springframework.social.twitter.connect.TwitterAdapter.setConnectionValues(TwitterAdapter.java:42) at org.springframework.social.twitter.connect.TwitterAdapter.setConnectionValues(TwitterAdapter.java:30) at org.springframework.social.connect.support.AbstractConnection.setValues(AbstractConnection.java:172) at org.springframework.social.connect.support.AbstractConnection.initKey(AbstractConnection.java:135) at org.springframework.social.connect.support.OAuth1Connection.(OAuth1Connection.java:57) at org.springframework.social.connect.support.OAuth1ConnectionFactory.createConnection(OAuth1ConnectionFactory.java:59) at org.springframework.social.connect.web.ConnectController.oauth1Callback(ConnectController.java:160) {code} Facebook: {code} org.springframework.web.client.ResourceAccessException: I/O error: Timeout while fetching: https://graph.facebook.com/me; nested exception is java.net.SocketTimeoutException: Timeout while fetching: https://graph.facebook.com/me at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:453) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:415) at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:213) at org.springframework.social.facebook.api.impl.FacebookTemplate.fetchObject(FacebookTemplate.java:170) at org.springframework.social.facebook.api.impl.UserTemplate.getUserProfile(UserTemplate.java:41) at org.springframework.social.facebook.api.impl.UserTemplate.getUserProfile(UserTemplate.java:37) at org.springframework.social.facebook.connect.FacebookAdapter.setConnectionValues(FacebookAdapter.java:42) at org.springframework.social.facebook.connect.FacebookAdapter.setConnectionValues(FacebookAdapter.java:30) {code}

    Spring JIRA | 5 years ago | Scott Murphy
    org.springframework.web.client.ResourceAccessException: I/O error: Timeout while fetching: https://graph.facebook.com/me; nested exception is java.net.SocketTimeoutException: Timeout while fetching: https://graph.facebook.com/me
  2. 0

    This is a major problem on Google App Engine. I am periodically getting exceptions using twitter and facebook. I need to be able to change the default timeout on a request from 5 (default) to 10 seconds. http://code.google.com/appengine/docs/java/urlfetch/overview.html "You can set a deadline for a request, the most amount of time the service will wait for a response. By default, the deadline for a fetch is 5 seconds. The maximum deadline is 10 seconds for online requests and 10 minutes for offline requests. When using the URLConnection interface, the service uses the connection timeout (setConnectTimeout()) plus the read timeout (setReadTimeout()) as the deadline." The solution would be to extend SimpleClientHttpRequestFactory, but there doesn't appear to be a simple way to inject it. Perhaps allowing the user to provide their own ClientHttpRequestFactorySelector as a Spring bean might be a solution? This is what I need: {code} public class GAESimpleClientHttpRequestFactory extends SimpleClientHttpRequestFactory { @Override protected void prepareConnection(HttpURLConnection connection, String httpMethod) throws IOException { connection.setConnectTimeout(10); connection.setReadTimeout(10); super.prepareConnection(connection, httpMethod); } } {code} This is the pain I am experiencing: Twitter: {code} Caused by: org.springframework.web.client.ResourceAccessException: I/O error: Timeout while fetching: https://api.twitter.com/1/account/verify_credentials.json; nested exception is java.net.SocketTimeoutException: Timeout while fetching: https://api.twitter.com/1/account/verify_credentials.json at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:453) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:415) at org.springframework.web.client.RestTemplate.getForObject(RestTemplate. java:213) at org.springframework.social.twitter.api.impl.UserTemplate.getUserProfile(UserTemplate.java:54) at org.springframework.social.twitter.connect.TwitterAdapter.setConnectionValues(TwitterAdapter.java:42) at org.springframework.social.twitter.connect.TwitterAdapter.setConnectionValues(TwitterAdapter.java:30) at org.springframework.social.connect.support.AbstractConnection.setValues(AbstractConnection.java:172) at org.springframework.social.connect.support.AbstractConnection.initKey(AbstractConnection.java:135) at org.springframework.social.connect.support.OAuth1Connection.(OAuth1Connection.java:57) at org.springframework.social.connect.support.OAuth1ConnectionFactory.createConnection(OAuth1ConnectionFactory.java:59) at org.springframework.social.connect.web.ConnectController.oauth1Callback(ConnectController.java:160) {code} Facebook: {code} org.springframework.web.client.ResourceAccessException: I/O error: Timeout while fetching: https://graph.facebook.com/me; nested exception is java.net.SocketTimeoutException: Timeout while fetching: https://graph.facebook.com/me at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:453) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:415) at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:213) at org.springframework.social.facebook.api.impl.FacebookTemplate.fetchObject(FacebookTemplate.java:170) at org.springframework.social.facebook.api.impl.UserTemplate.getUserProfile(UserTemplate.java:41) at org.springframework.social.facebook.api.impl.UserTemplate.getUserProfile(UserTemplate.java:37) at org.springframework.social.facebook.connect.FacebookAdapter.setConnectionValues(FacebookAdapter.java:42) at org.springframework.social.facebook.connect.FacebookAdapter.setConnectionValues(FacebookAdapter.java:30) {code}

    Spring JIRA | 5 years ago | Scott Murphy
    org.springframework.web.client.ResourceAccessException: I/O error: Timeout while fetching: https://graph.facebook.com/me; nested exception is java.net.SocketTimeoutException: Timeout while fetching: https://graph.facebook.com/me
  3. 0

    This is a major problem on Google App Engine. I am periodically getting exceptions using twitter and facebook. I need to be able to change the default timeout on a request from 5 (default) to 10 seconds. http://code.google.com/appengine/docs/java/urlfetch/overview.html "You can set a deadline for a request, the most amount of time the service will wait for a response. By default, the deadline for a fetch is 5 seconds. The maximum deadline is 10 seconds for online requests and 10 minutes for offline requests. When using the URLConnection interface, the service uses the connection timeout (setConnectTimeout()) plus the read timeout (setReadTimeout()) as the deadline." The solution would be to extend SimpleClientHttpRequestFactory, but there doesn't appear to be a simple way to inject it. Perhaps allowing the user to provide their own ClientHttpRequestFactorySelector as a Spring bean might be a solution? This is what I need: {code} public class GAESimpleClientHttpRequestFactory extends SimpleClientHttpRequestFactory { @Override protected void prepareConnection(HttpURLConnection connection, String httpMethod) throws IOException { connection.setConnectTimeout(10); connection.setReadTimeout(10); super.prepareConnection(connection, httpMethod); } } {code} This is the pain I am experiencing: Twitter: {code} Caused by: org.springframework.web.client.ResourceAccessException: I/O error: Timeout while fetching: https://api.twitter.com/1/account/verify_credentials.json; nested exception is java.net.SocketTimeoutException: Timeout while fetching: https://api.twitter.com/1/account/verify_credentials.json at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:453) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:415) at org.springframework.web.client.RestTemplate.getForObject(RestTemplate. java:213) at org.springframework.social.twitter.api.impl.UserTemplate.getUserProfile(UserTemplate.java:54) at org.springframework.social.twitter.connect.TwitterAdapter.setConnectionValues(TwitterAdapter.java:42) at org.springframework.social.twitter.connect.TwitterAdapter.setConnectionValues(TwitterAdapter.java:30) at org.springframework.social.connect.support.AbstractConnection.setValues(AbstractConnection.java:172) at org.springframework.social.connect.support.AbstractConnection.initKey(AbstractConnection.java:135) at org.springframework.social.connect.support.OAuth1Connection.(OAuth1Connection.java:57) at org.springframework.social.connect.support.OAuth1ConnectionFactory.createConnection(OAuth1ConnectionFactory.java:59) at org.springframework.social.connect.web.ConnectController.oauth1Callback(ConnectController.java:160) {code} Facebook: {code} org.springframework.web.client.ResourceAccessException: I/O error: Timeout while fetching: https://graph.facebook.com/me; nested exception is java.net.SocketTimeoutException: Timeout while fetching: https://graph.facebook.com/me at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:453) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:415) at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:213) at org.springframework.social.facebook.api.impl.FacebookTemplate.fetchObject(FacebookTemplate.java:170) at org.springframework.social.facebook.api.impl.UserTemplate.getUserProfile(UserTemplate.java:41) at org.springframework.social.facebook.api.impl.UserTemplate.getUserProfile(UserTemplate.java:37) at org.springframework.social.facebook.connect.FacebookAdapter.setConnectionValues(FacebookAdapter.java:42) at org.springframework.social.facebook.connect.FacebookAdapter.setConnectionValues(FacebookAdapter.java:30) {code}

    Spring JIRA | 5 years ago | Scott Murphy
    org.springframework.web.client.ResourceAccessException: I/O error: Timeout while fetching: https://graph.facebook.com/me; nested exception is java.net.SocketTimeoutException: Timeout while fetching: https://graph.facebook.com/me
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    This is a major problem on Google App Engine. I am periodically getting exceptions using twitter and facebook. I need to be able to change the default timeout on a request from 5 (default) to 10 seconds. http://code.google.com/appengine/docs/java/urlfetch/overview.html "You can set a deadline for a request, the most amount of time the service will wait for a response. By default, the deadline for a fetch is 5 seconds. The maximum deadline is 10 seconds for online requests and 10 minutes for offline requests. When using the URLConnection interface, the service uses the connection timeout (setConnectTimeout()) plus the read timeout (setReadTimeout()) as the deadline." The solution would be to extend SimpleClientHttpRequestFactory, but there doesn't appear to be a simple way to inject it. Perhaps allowing the user to provide their own ClientHttpRequestFactorySelector as a Spring bean might be a solution? This is what I need: {code} public class GAESimpleClientHttpRequestFactory extends SimpleClientHttpRequestFactory { @Override protected void prepareConnection(HttpURLConnection connection, String httpMethod) throws IOException { connection.setConnectTimeout(10); connection.setReadTimeout(10); super.prepareConnection(connection, httpMethod); } } {code} This is the pain I am experiencing: Twitter: {code} Caused by: org.springframework.web.client.ResourceAccessException: I/O error: Timeout while fetching: https://api.twitter.com/1/account/verify_credentials.json; nested exception is java.net.SocketTimeoutException: Timeout while fetching: https://api.twitter.com/1/account/verify_credentials.json at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:453) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:415) at org.springframework.web.client.RestTemplate.getForObject(RestTemplate. java:213) at org.springframework.social.twitter.api.impl.UserTemplate.getUserProfile(UserTemplate.java:54) at org.springframework.social.twitter.connect.TwitterAdapter.setConnectionValues(TwitterAdapter.java:42) at org.springframework.social.twitter.connect.TwitterAdapter.setConnectionValues(TwitterAdapter.java:30) at org.springframework.social.connect.support.AbstractConnection.setValues(AbstractConnection.java:172) at org.springframework.social.connect.support.AbstractConnection.initKey(AbstractConnection.java:135) at org.springframework.social.connect.support.OAuth1Connection.(OAuth1Connection.java:57) at org.springframework.social.connect.support.OAuth1ConnectionFactory.createConnection(OAuth1ConnectionFactory.java:59) at org.springframework.social.connect.web.ConnectController.oauth1Callback(ConnectController.java:160) {code} Facebook: {code} org.springframework.web.client.ResourceAccessException: I/O error: Timeout while fetching: https://graph.facebook.com/me; nested exception is java.net.SocketTimeoutException: Timeout while fetching: https://graph.facebook.com/me at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:453) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:415) at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:213) at org.springframework.social.facebook.api.impl.FacebookTemplate.fetchObject(FacebookTemplate.java:170) at org.springframework.social.facebook.api.impl.UserTemplate.getUserProfile(UserTemplate.java:41) at org.springframework.social.facebook.api.impl.UserTemplate.getUserProfile(UserTemplate.java:37) at org.springframework.social.facebook.connect.FacebookAdapter.setConnectionValues(FacebookAdapter.java:42) at org.springframework.social.facebook.connect.FacebookAdapter.setConnectionValues(FacebookAdapter.java:30) {code}

    Spring JIRA | 5 years ago | Scott Murphy
    org.springframework.web.client.ResourceAccessException: I/O error: Timeout while fetching: https://graph.facebook.com/me; nested exception is java.net.SocketTimeoutException: Timeout while fetching: https://graph.facebook.com/me
  6. 0

    VMware Communities : All Content - VMware vRealize Orchestrator

    rssing.com | 11 months ago
    org.springframework.web.client.ResourceAccessException: I/O error: peer not authenticated; nested exception is javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.web.client.ResourceAccessException

      I/O error: Timeout while fetching: https://graph.facebook.com/me; nested exception is java.net.SocketTimeoutException: Timeout while fetching: https://graph.facebook.com/me

      at org.springframework.web.client.RestTemplate.doExecute()
    2. Spring
      RestTemplate.getForObject
      1. org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:453)
      2. org.springframework.web.client.RestTemplate.execute(RestTemplate.java:415)
      3. org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:213)
      3 frames
    3. Facebook API
      FacebookAdapter.setConnectionValues
      1. org.springframework.social.facebook.api.impl.FacebookTemplate.fetchObject(FacebookTemplate.java:170)
      2. org.springframework.social.facebook.api.impl.UserTemplate.getUserProfile(UserTemplate.java:41)
      3. org.springframework.social.facebook.api.impl.UserTemplate.getUserProfile(UserTemplate.java:37)
      4. org.springframework.social.facebook.connect.FacebookAdapter.setConnectionValues(FacebookAdapter.java:42)
      5. org.springframework.social.facebook.connect.FacebookAdapter.setConnectionValues(FacebookAdapter.java:30)
      5 frames