org.springframework.web.client.ResourceAccessException: I/O error on GE T request for "http://spotparking/spotparking/pincode": spotparking; nested exception is java.net.UnknownHostException: spotparking] with root cause java.net.UnknownHostException: spotparking

Stack Overflow | focode | 2 months ago
  1. 0

    Ribbon client not able to discover microservices registered with eureka

    Stack Overflow | 2 months ago | focode
    org.springframework.web.client.ResourceAccessException: I/O error on GE T request for "http://spotparking/spotparking/pincode": spotparking; nested exception is java.net.UnknownHostException: spotparking] with root cause java.net.UnknownHostException: spotparking
  2. 0

    Error writing unbuffered REST request body to server - Spring Forum

    spring.io | 11 months ago
    org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://upload-...":Error writing request body to server; nested exception is java.io.IOException: Error writing request body to server
  3. 0

    Gitlab + SSL Issues

    GitHub | 3 months ago | bgabler
    org.springframework.web.client.ResourceAccessException: I/O error on POST request for "https://PROXY_URL_HERE/oauth/token":sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target] with root cause sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    java.net.ConnectException when trying to connect through http proxy with authentication

    GitHub | 2 months ago | phoenixzero2
    org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://start.spring.io": Connection timed out: connect; nested exception is java.net.ConnectException: Connection timed out: connect
  6. 0

    {code:java} restTemplate.put("http://SomeService/update-status/{0}?status={1}", null, id, status); {code} In this case I am calling a service to update a status field on an object, specified by an id in the URL path and the new status as a query string parameter. The Javadoc for RestOperations.put indicates that null is a valid, but when I do this an exception is thrown, shown below. The same occurs if I use postForEntity instead of put. The doc for postForEntity also states that null is valid as the request body. {code:java} org.springframework.web.client.ResourceAccessException: I/O error on PUT request for "http://SomeService/update-status/56333d18e4b098563b66bda4?status=Deleted":com.sun.jersey.api.client.ClientHandlerException: org.apache.http.client.ClientProtocolException; nested exception is java.io.IOException: com.sun.jersey.api.client.ClientHandlerException: org.apache.http.client.ClientProtocolException at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:580) ~[spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:530) ~[spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.web.client.RestTemplate.put(RestTemplate.java:382) ~[spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE] ...etc... Caused by: java.io.IOException: com.sun.jersey.api.client.ClientHandlerException: org.apache.http.client.ClientProtocolException at org.springframework.cloud.netflix.ribbon.RibbonClientHttpRequestFactory$RibbonHttpRequest.executeInternal(RibbonClientHttpRequestFactory.java:125) ~[spring-cloud-netflix-core-1.0.3.RELEASE.jar:1.0.3.RELEASE] at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53) ~[spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:569) ~[spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE] ... 112 common frames omitted Caused by: com.sun.jersey.api.client.ClientHandlerException: org.apache.http.client.ClientProtocolException at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:184) ~[jersey-apache-client4-1.11.jar:1.11] at com.sun.jersey.api.client.Client.handle(Client.java:648) ~[jersey-client-1.11.jar:1.11] at com.sun.jersey.api.client.WebResource.handle(WebResource.java:670) ~[jersey-client-1.11.jar:1.11] at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74) ~[jersey-client-1.11.jar:1.11] at com.sun.jersey.api.client.WebResource$Builder.put(WebResource.java:533) ~[jersey-client-1.11.jar:1.11] at com.netflix.niws.client.http.RestClient.execute(RestClient.java:624) ~[ribbon-httpclient-2.0.2.jar:2.0.2] at com.netflix.niws.client.http.RestClient.execute(RestClient.java:527) ~[ribbon-httpclient-2.0.2.jar:2.0.2] at org.springframework.cloud.netflix.ribbon.RibbonClientHttpRequestFactory$RibbonHttpRequest.executeInternal(RibbonClientHttpRequestFactory.java:122) ~[spring-cloud-netflix-core-1.0.3.RELEASE.jar:1.0.3.RELEASE] ... 114 common frames omitted Caused by: org.apache.http.client.ClientProtocolException: null at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:867) ~[httpclient-4.3.4.jar:4.3.4] at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:115) ~[httpclient-4.3.4.jar:4.3.4] at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57) ~[httpclient-4.3.4.jar:4.3.4] at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:170) ~[jersey-apache-client4-1.11.jar:1.11] ... 121 common frames omitted Caused by: org.apache.http.ProtocolException: Content-Length header already present at org.apache.http.protocol.RequestContent.process(RequestContent.java:95) ~[httpcore-4.3.2.jar:4.3.2] at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:131) ~[httpcore-4.3.2.jar:4.3.2] at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:165) ~[httpcore-4.3.2.jar:4.3.2] at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:485) ~[httpclient-4.3.4.jar:4.3.4] at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863) ~[httpclient-4.3.4.jar:4.3.4] {code} The problem is easily worked around by passing an empty string instead of null, but as the doc explicitly states that null is permitted, then this seems like a bug. Initial investigation suggests that HttpCore does not expect the Content-Length header to be already set, and HttpEntityRequestCallback.doWithRequest is setting it when the body is null, hence the exception.

    Spring JIRA | 1 year ago | Paul Crockett
    org.springframework.web.client.ResourceAccessException: I/O error on PUT request for "http://SomeService/update-status/56333d18e4b098563b66bda4?status=Deleted":com.sun.jersey.api.client.ClientHandlerException: org.apache.http.client.ClientProtocolException; nested exception is java.io.IOException: com.sun.jersey.api.client.ClientHandlerException: org.apache.http.client.ClientProtocolException

    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 on GE T request for "http://spotparking/spotparking/pincode": spotparking; nested exception is java.net.UnknownHostException: spotparking] with root cause java.net.UnknownHostException: spotparking

      at java.net.AbstractPlainSocketImpl.connect()
    2. Java RT
      AbstractPlainSocketImpl.connect
      1. java.net.AbstractPlainSocketImpl.connect(Unknown Source)[na:1.8.0_101]
      1 frame