Java Question java.lang.NoClassDefFoundError: Failed resolution of: Lcom/facepp/http/HttpRequests;

Discussion in 'Libraries developers questions' started by DonManfred, Jan 24, 2015.

  1. DonManfred

    DonManfred Expert Licensed User

    i´m writing a wrapper for face++ using the jar they provide.

    the example shows the use of a HttpRequests wrapper
    Code:
    Open Declaration com.facepp.http.HttpRequests
    request 
    to faceplusplus.com
    new HttpRequests(apiKey, apiSecret).request(
    "detection""detect", postParameters)
    new HttpRequests(apiKey, apiSecret).train()

    Since:
    1.0.0
    Version:
    1.2.0
    Code:
    new Thread(new Runnable() {
                
    public void run() {
                    HttpRequests httpRequests = new HttpRequests(
    "api_key""api_secret");
    The wrapper compiles fine with slc but when i want to use it in a b4a project i got the above error

    I tried
    Code:
    import com.facepp.http.*s;
    import com.facepp.error.*;
    import com.facepp.result.*;
    and
    Code:
    import com.facepp.http.HttpRequests;
    import com.facepp.http.PostParameters;
    import com.facepp.error.FaceppParseException;
    import com.facepp.result.FaceppResult;
    Everytime the same result.
     
  2. thedesolatesoul

    thedesolatesoul Expert Licensed User

    Open their jar with jd-gui and check if the HttpRequests class actually exists inside that jar.
     
  3. DonManfred

    DonManfred Expert Licensed User

    Seem that this class do exists.

    [​IMG]
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Have you added the @DependsOn annotation? Can you post the full error message. Sometimes the top message can be misleading.
     
  5. DonManfred

    DonManfred Expert Licensed User

    Code:
    @DependsOn(values={"faceplusplus"})
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Not sure why it happens. Note that you don't really need a library for this. They provide REST api which doesn't look too complicated.
     
  7. DonManfred

    DonManfred Expert Licensed User

    They provide a Android jar too. Why should i write my own rest solution when the provide a jar with everything included. I just need a wrapper. And writing the wrapper was much less work than building a rest solution
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice