content
FaceRect
  Last updated: 20/6/2018
  • Installs:
  • Today: 4
  • All Time: 75924
Developer:userapicloud
Discussions
2 Answers
Follow conversation
NoSuchFieldError
Hi

I am trying to use the face rect api from my java appliaction. I have added the necessary jars and executed the application. Nu I am getting the following error.

Exception in thread "main" java.lang.NoSuchFieldError: DEFAULT
at org.apache.http.impl.nio.client.HttpAsyncClientBuilder.build(HttpAsyncClientBuilder.java:353)
at com.mashape.unirest.http.options.Options.refresh(Options.java:43)
at com.mashape.unirest.http.options.Options.<clinit>(Options.java:27)
at com.mashape.unirest.http.HttpClientHelper.prepareRequest(HttpClientHelper.java:146)
at com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:123)
at com.mashape.unirest.request.BaseRequest.asJson(BaseRequest.java:68)
at Main.main(Main.java:20)
Java Result: 1

This is the java code which I executed.

public class Main {

public static void main(String[] args) throws UnirestException, JSONException {
HttpResponse<JsonNode> request = Unirest.post("https://apicloud-facerect.p.mashape.com/process-file.json")
.header("X-Mashape-Authorization", "YfG4JGGx1u5tsXE75EzzADm7DKfKZler")
.field("image", new File("d:\\f.jpg"))
.field("features", "false")
.asJson();

}
}
user
ashishspanickerresponded with an answer
Hey Andy

Thanks for the support. As you mentioned jar files was the issue. Now its working fine.

Thanks
Ashish
user
apicloudresponded with an answer
Hi there!

Your code seems correct and it works for me. I suppose you have an issue with external JARs. Please make sure you downloaded and added all the following JARs with exact same versions:


After adding all the JARs your code should work. Hope that helps!

Andy
userHello developer, Please Sign in to post an answer
x
circle
FaceRect
$ / m
We will charge your card every month for the plan amount, as well as any overages incurred in the previous month.
?

Oops, we are missing some details

Looks like there are a few missing details that you haven't filled in yet.
These details are important and will help us protect you and let you know about anything new.

x

Why sign up to RapidAPI?

  • integrate
    Integrate APIs into your app
    Ruby, Java, Elixir, Node.js, Phyton, Objective C, Swift, PHP and MORE
  • keys
    Save all API keys in one place
  • notifications
    Get notifications about API changes
  • stats
    Get stats and monitor API connections
__SING_UP_WITH_GITHUB__
__SING_UP_WITH_FACEBOOK__
__SING_UP_WITH_GOOGLE__
  • We're not going to post anything on your wall.
  • We're not planning to spam you.
  • esccloses this view
    x

    Authentication

    Authenticate
    esccloses this view