On Fri, 2018-01-19 at 13:37 -0700, Russell Bateman wrote:
> I haven't used an Apache HTTP client in a few years. So, I've
> started 
> fresh. Having written precious little code carefully following 
> http://hc.apache.org/httpcomponents-client-4.5.x/quickstart.html, I
> get 
> this exception as soon as I call createDefault():
> 
> /*    CloseableHttpClient client = HttpClients.createDefault();*/
>      HttpGet             get    = new HttpGet( query );
> 
>      get.setHeader( ACCEPT_CHARSET, UTF8 );
>      get.setHeader( "Accept", "application/xml,application/json" );
> 
>      CloseableHttpResponse response = client.execute( get );
>      HttpEntity            entity   = response.getEntity();
> 
>      try
>      {
>        return entity.getContent();
>      }
>      catch( IOException e )
>      {
>        throw new IOException( e.getMessage() + " occurred getting
> query 
> response" );
>      }
>      finally
>      {
>        response.close();
>      }
> 
> I die similarly in my POST requests.
> 
> The full stack trace follows (below), but here's what I have in 
> /pom.xml/:. I added the httpcore out of desperation and googling for 
> this problem. No matter, it happens with or without it and no matter 
> what version I add.
> 
>      <apache.http.client.version>*4.5.4*</apache.http.client.version>
> 
> *    <dependency>**
> **<groupId>org.apache.httpcomponents</groupId>**
> **<artifactId>httpclient</artifactId>**
> **<version>${apache.http.client.version}</version>**
> **    </dependency>*
>      <dependency>
> <groupId>org.apache.httpcomponents</groupId>
>        <artifactId>httpcore</artifactId>
>        <version>*4.4.7*</version>
>      </dependency>
> 
> What have I done wrong?
> 

Your dependency tree appears to be wrong. Something is pulling an old
version of HttpCore.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to