As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
Thanks
AJ
Hello AJ,
The much more descriptive error message that our server is returning should give you some insight into why this isn't working:
{"error":"InsufficientCredentials","description":"The credentials used to authenticate this request are not authorized to run this operation. Please retry your request with appropriate credentials","debug":"Please authenticate as an app End User or as the app admin using the Master secret to run this operation"}
Please note, this not displaying correctly in the Java library is something that we plan to address, but for the time being this should help you understand the problem at hand (you need to be signed in as a user, or use master secret for this to succeed. You cannot simply use the app secret to make this operation successful.
Thanks,
Anubhav,
Based on the error output, it seems as though you didn't do a full clean and build. If you take a look in the debug logs:
CONFIG: {"id":"1","location":"Kharadi","name":"Office","time":"10AM"}
Shows up despite id = 1 being commented out in your code above. Can you please ensure that you are doing a full clean build and try this again?
Thanks,
Hello Anubhav,
Can you please enable library debugging as outlined here: http://devcenter.kinvey.com/java/guides/troubleshooting and let me know what you see in terms of server response?
Thanks,
Alright, thank you for posting that.
To get into what we think is happening:
1.The line of code:
Boolean ping = ping = myJavaClient.ping();
Is not valid Java. This should probably be: Boolean ping = myJavaClient.ping();
2. This issue is most likely a problem with the user you're trying to use not being on the ACL for the object you are trying to save to. If you remove the line of code:
eventE.setId("1");
This should allow the ID to be set automatically, which would then assign this to a randomized ID, which would then have this user as the ACL creator, and thus able to save over it.
That being said, the library isn't descriptive enough about what the error is, or how it was caused, so we will address this in a future update to the library.
Thanks,
Anubhav Jain
Here is the code snippet...
Client myJavaClient = new Client.Builder(appKey, appSecret).build();
myJavaClient.enableDebugLogging();
Boolean ping = ping = myJavaClient.ping();
System.out.println("Connected to client? " + ping);
User result = myJavaClient.user().loginBlocking("anujain", "anujain").execute();
System.out.println("isUserLoggedIn:: " + result.isUserLoggedIn());
eventE.setId("1");
eventE.setName("Office");
eventE.setLocation("Kharadi");
eventE.setTime("10AM");
AppData appData = myJavaClient.appData("EventCollection", EventEntity.class);
appData.saveBlocking(eventE).execute();
----------------------------------------------------------------------------------------
And here is the output:
Hello World
Connected to client? true
isUserLoggedIn:: true
Exception in main method:: com.kinvey.java.core.KinveyJsonResponseException: unknown
com.kinvey.java.core.KinveyJsonResponseException: unknown
at com.kinvey.java.core.KinveyJsonResponseException.from(KinveyJsonResponseException.java:91)
at com.kinvey.java.core.AbstractKinveyJsonClientRequest.newExceptionOnError(AbstractKinveyJsonClientRequest.java:70)
at com.kinvey.java.core.AbstractKinveyJsonClientRequest.newExceptionOnError(AbstractKinveyJsonClientRequest.java:28)
at com.kinvey.java.core.AbstractKinveyClientRequest.executeUnparsed(AbstractKinveyClientRequest.java:441)
at com.kinvey.java.core.AbstractKinveyClientRequest.executeUnparsed(AbstractKinveyClientRequest.java:357)
at com.kinvey.java.core.AbstractKinveyClientRequest.execute(AbstractKinveyClientRequest.java:466)
at com.kinvey.java.offline.AbstractKinveyOfflineClientRequest.offlineFromService(AbstractKinveyOfflineClientRequest.java:133)
at com.kinvey.java.offline.OfflinePolicy$1.execute(OfflinePolicy.java:43)
at com.kinvey.java.offline.AbstractKinveyOfflineClientRequest.execute(AbstractKinveyOfflineClientRequest.java:159)
at HelloWorld.main(HelloWorld.java:88)