I have a Maven Java project that uses Mashape Unirest for sending HTTP requests to other URLs. I am currently writing an integration test (using TestNG) tha
I faced the same exception using unirest:
java.lang.NoSuchFieldError: INSTANCE
at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.(DefaultHttpRequestWriterFactory.java:52)
at com.mashape.unirest.http.options.Options.refresh(Options.java:55)
at com.mashape.unirest.http.options.Options.(Options.java:36)
And found it was due to DefaultConnectionKeepAliveStrategy.INSTANCE;
and the conflicting jar was apache-httpcomponents-httpclient.jar
in my classpath. Adding this post to help anyone who faces similar exception