Skip to content

Failed to save ParseUser: org.json.JSONObject$1 cannot be cast to java.util.Map #376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alexblack opened this issue Jan 28, 2016 · 3 comments

Comments

@alexblack
Copy link

A few users are experiencing this error, being unable to save the ParseUser is preventing them from using the app properly.

Non-fatal Exception: java.lang.ClassCastException: org.json.JSONObject$1 cannot be cast to java.util.Map
       at com.parse.ParseUser.getAuthData(ParseUser.java:340)
       at com.parse.ParseUser.synchronizeAuthDataAsync(ParseUser.java:1245)
       at com.parse.ParseUser.synchronizeAllAuthDataAsync(ParseUser.java:1234)
       at com.parse.CachedCurrentUserController$1$2.then(CachedCurrentUserController.java:71)
       at com.parse.CachedCurrentUserController$1$2.then(CachedCurrentUserController.java:67)
       at bolts.Task$15.run(Task.java:917)
       at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
       at bolts.Task.completeAfterTask(Task.java:908)
       at bolts.Task.continueWithTask(Task.java:715)
       at bolts.Task.continueWithTask(Task.java:726)
       at bolts.Task$13.then(Task.java:818)
       at bolts.Task$13.then(Task.java:806)
       at bolts.Task$15.run(Task.java:917)
       at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
       at bolts.Task.completeAfterTask(Task.java:908)
       at bolts.Task.continueWithTask(Task.java:715)
       at bolts.Task.continueWithTask(Task.java:690)
       at bolts.Task.onSuccessTask(Task.java:806)
       at bolts.Task.onSuccessTask(Task.java:796)
       at bolts.Task.onSuccessTask(Task.java:830)
       at com.parse.CachedCurrentUserController$1.then(CachedCurrentUserController.java:47)
       at com.parse.CachedCurrentUserController$1.then(CachedCurrentUserController.java:44)
       at com.parse.TaskQueue.enqueue(TaskQueue.java:69)
       at com.parse.CachedCurrentUserController.setAsync(CachedCurrentUserController.java:44)
       at com.parse.CachedCurrentUserController.setAsync(CachedCurrentUserController.java:17)
       at com.parse.ParseUser.saveCurrentUserAsync(ParseUser.java:926)
       at com.parse.ParseUser.access$200(ParseUser.java:30)
       at com.parse.ParseUser$1.then(ParseUser.java:496)
       at com.parse.ParseUser$1.then(ParseUser.java:493)
       at bolts.Task$15.run(Task.java:917)
       at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
       at bolts.Task.completeAfterTask(Task.java:908)
       at bolts.Task.continueWithTask(Task.java:715)
       at bolts.Task.continueWithTask(Task.java:726)
       at bolts.Task$13.then(Task.java:818)
       at bolts.Task$13.then(Task.java:806)
       at bolts.Task$15.run(Task.java:917)
       at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
       at bolts.Task.completeAfterTask(Task.java:908)
       at bolts.Task.access$100(Task.java:32)
       at bolts.Task$11.then(Task.java:708)
       at bolts.Task$11.then(Task.java:705)
       at bolts.Task.runContinuations(Task.java:956)
       at bolts.Task.trySetResult(Task.java:994)
       at bolts.TaskCompletionSource.trySetResult(TaskCompletionSource.java:39)
       at bolts.TaskCompletionSource.setResult(TaskCompletionSource.java:62)
       at bolts.Task$15$1.then(Task.java:934)
       at bolts.Task$15$1.then(Task.java:921)
       at bolts.Task$14.run(Task.java:872)
       at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
       at bolts.Task.completeImmediately(Task.java:863)
       at bolts.Task.continueWith(Task.java:661)
       at bolts.Task.continueWith(Task.java:672)
       at bolts.Task$15.run(Task.java:921)
       at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
       at bolts.Task.completeAfterTask(Task.java:908)
       at bolts.Task.access$100(Task.java:32)
       at bolts.Task$11.then(Task.java:708)
       at bolts.Task$11.then(Task.java:705)
       at bolts.Task.runContinuations(Task.java:956)
       at bolts.Task.trySetResult(Task.java:994)
       at bolts.TaskCompletionSource.trySetResult(TaskCompletionSource.java:39)
       at bolts.TaskCompletionSource.setResult(TaskCompletionSource.java:62)
       at bolts.Task$15$1.then(Task.java:934)
       at bolts.Task$15$1.then(Task.java:921)
       at bolts.Task$14.run(Task.java:872)
       at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
       at bolts.Task.completeImmediately(Task.java:863)
       at bolts.Task.access$000(Task.java:32)
       at bolts.Task$10.then(Task.java:654)
       at bolts.Task$10.then(Task.java:651)
       at bolts.Task.runContinuations(Task.java:956)
       at bolts.Task.trySetResult(Task.java:994)
       at bolts.TaskCompletionSource.trySetResult(TaskCompletionSource.java:39)
       at bolts.TaskCompletionSource.setResult(TaskCompletionSource.java:62)
       at bolts.Task$15$1.then(Task.java:934)
       at bolts.Task$15$1.then(Task.java:921)
       at bolts.Task$14.run(Task.java:872)
       at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
       at bolts.Task.completeImmediately(Task.java:863)
       at bolts.Task.access$000(Task.java:32)
       at bolts.Task$10.then(Task.java:654)
       at bolts.Task$10.then(Task.java:651)
       at bolts.Task.runContinuations(Task.java:956)
       at bolts.Task.trySetResult(Task.java:994)
       at bolts.TaskCompletionSource.trySetResult(TaskCompletionSource.java:39)
       at bolts.TaskCompletionSource.setResult(TaskCompletionSource.java:62)
       at bolts.Task$15$1.then(Task.java:934)
       at bolts.Task$15$1.then(Task.java:921)
       at bolts.Task$14.run(Task.java:872)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
       at java.lang.Thread.run(Thread.java:818)

Meta data collected:

msg org.json.JSONObject$1 cannot be cast to java.util.Map 
createdat   Mon Jan 18 07:13:18 AEDT 2016 
name    parse-user.save-failed 
appversion  0.1.199 
idx 226 
objectid    Vvm5qEoy4O 
runcount    11 
updatedat   Fri Jan 29 07:27:09 AEDT 2016 
@grantland
Copy link
Contributor

I haven't had time to review this in depth, but you shouldn't be posting sessionTokens publicly. They can be used by a third party to authenticate with your app as that user and would have access to your user's private data.

@alexblack
Copy link
Author

Thanks.

@natario1
Copy link
Contributor

This was caused by a bug in ParseUserCurrentCoder and was fixed in #724 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants