Start a new topic

No Such Method Error

As a new user I am trying to follow some of the common examples from this website. I'm having a few issues with methods I'm trying to use such as loginBlocking(). When developing in eclipse it recognizes the method name, and I see it in the added .jar files, but upon execution it throws a No Such Method Error.



A second part to this is the .execute() method in the Users class. It is used in many examples of code and it simply doesn't exist in my libraries. I'm using Kinvey 2.6.14 which I believe is the most recent version. Any help here?

Hey,



this is a strange error, and it seems like something might be wrong with the compilation environment. I just double checked the Java 8 javadocs, and the `Object` class does not even contain an `execute()` method... I'm not sure why your IDE would try to enforce that.



Also, as you mentioned, other machines are able to compile and run the same code, which implies there is an issue with the environment.



I would recommend ensuring your version of java is up to date, possibly uninstalling it and reinstalling it.
Hey WSnead, sorry for the delay on this- our Java lib author is taking a look now.
As an update, other people have compiled my code on their machine using the same version of Eclipse, JDK 1.8, JRE 8, Apache 1.9.4, and same Kinvey Java 2.6.12 lib files. They have gotten succesfull builds while I can't even compile if the .execute() method is in my code. If I remove it I get the No Such method error at execution on the loginBlocking() method. The simple test program I'm running is below, but with proper app_key and secret strings.



import com.kinvey.nativejava.Client;



public class Test

{



private static final String APP_KEY = "";



private static final String APP_SECRET = "";



private static final String MASTER_SECRET = "";



public static void main(String[] args)

{

Client mKinveyClient = new Client.Builder(APP_KEY, MASTER_SECRET).build();

mKinveyClient.enableDebugLogging();

boolean ping = mKinveyClient.ping();

System.out.println("Client ping -> " + ping);



try

{

mKinveyClient.user().loginBlocking(APP_KEY, MASTER_SECRET).execute();

System.out.println("Client login -> " + mKinveyClient.user().isUserLoggedIn());

}

catch (Exception e)

{

System.out.println("Couldn't login -> " + e);

e.printStackTrace();

}

}

}
Login or Signup to post a comment