I am trying to use the Digital Ocean java library and when trying to create a connection with:
CloseableHttpClient httpClient = HttpClients.createDefault();
client = new DigitalOceanClient("v2", token, httpClient);
The problem lies in the CloseableHttpClient httpClient
object. The library uses httpcore version 4.4.1 and httpclient version 4.5. It gives me a java.lang.NoSuchFieldError.
Here's my log:
Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:144)
at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:955)
at org.apache.http.impl.client.HttpClients.createDefault(HttpClients.java:58)
at main.java.servers.DigitalOceanServer.setup(DigitalOceanServer.java:28)
I found little information and documentation on the NoSuchFieldError, so I'm assuming it has to do with the version of httpcore and/or httpclient that causes this error.