Start a new topic

Java Getting Started Guide Bug

In the very first part of the getting started guide for java. There is a bug in the documentation. Lne one of the very first example does not exist. There is no "client" class in the com.kinvey.java. There is one in com.kinvey.nativejava.Client tho.



See ya,

Sean


For got to post the page http://devcenter.kinvey.com/java/guides/getting-started#



Wow that is pretty bad. So I found some more errors hahaha. Looks like this guide needs some work haha. Did anyone run the code before they posted it?



In the second example on the same page the .ping() function should return a boolean not a Boolean.

In the same example I could be wrong but I do not thing Exception is spelled that way...... hahahaa

Also there should be only one import statment and again same applies as above. There is no com.kinvey.java.client.



See ya,

Sean
In the third example there is no execute() function on the loginblocking function. Not sure what is going on there. (Line 2)



P.S I also get a no such method exception no matter what I call on the user function.
Hey, thanks for pointing out the errors with the import statements-- I'll take a look at the getting started guide and fix some of the issues.



For the loginBlocking, issue, note that it is camelCase:



mykinveyClient.user().loginBlocking("myKey", "mySecret").execute();



If you are getting runtime exceptions, such as NoMethodFound, it might be a problem with the build path-- Ensure that the Kinvey dependencies are properly being packaged using your build process (ant/maven) into whatever target you are using (jar/war)

Ya I am starting to think it is a build issue. I followed the guide as close as I could. I have the jars imported but I am still getting issues. The pink works fine but I cannot get the login to work.



P.S Here is the error. I seem to be getting this with most functions on the user class. Exception in thread "main" java.lang.NoSuchMethodError: com.kinvey.nativejava.User.loginBlocking(Ljava/lang/String;Ljava/lang/String;)Lcom/kinvey/java/User;

at Main.main(Main.java:16)





Below is the code:



public static void main(String[] args) throws Exception {

boolean pingResult = mKinveyClient.ping();

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



mKinveyClient.user().loginBlocking("admin", "rty7vbnM").execute();

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

}
are you using maven or ant? And how are you packaging? I might be able to help. Also, what IDE are you using?
Do you have both jars, kinvey-java-2.6.15.jar as well as kinvey-java-lib-2.6.15.jar on your build path?



Also, double check the imports-- they should all be nativejava, which I will update in the guides.
Using eclipse in a brand new project. So what ever eclipse uses for packaging/building.
Yes both jars are in the build path as well as the other libs you guys use.



All the imports are nativejava



p.s nothing else has been added to the project except kinvey so.
Ummm must have been a build issue. It is working fine now. I am not sure what I did to fix it.

OK good to hear. Also, just so ya know, Eclipse uses Ant by default.



Thanks again for the reports about the documentation. Let me know if ya run into any more issues.
Can you do geo queries in the java sdk?



Nevermind I found it.
Login or Signup to post a comment