andrasbak / cloud-tasks-io

Automatically exported from code.google.com/p/cloud-tasks-io
0 stars 0 forks source link

Error when registering: Could not parse payload #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm running into the following error when running the basic big daddy 
application.  Android 2.3.3 Nexus One.

05-22 13:58:04.563: ERROR/AndroidRuntime(16803): FATAL EXCEPTION: 
IntentService[---]
05-22 13:58:04.563: ERROR/AndroidRuntime(16803): java.lang.RuntimeException: 
Could not parse payload: payload[0] = <
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
com.google.web.bindery.autobean.vm.impl.JsonSplittable.create(JsonSplittable.jav
a:79)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
com.google.web.bindery.autobean.shared.impl.StringQuoter.split(StringQuoter.java
:73)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
com.google.web.bindery.autobean.shared.AutoBeanCodex.decode(AutoBeanCodex.java:5
4)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$Standar
dPayloadDialect.processPayload(AbstractRequestContext.java:295)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$4.onTra
nsportSuccess(AbstractRequestContext.java:1021)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
com.coolbeans.textify.AndroidRequestTransport.send(AndroidRequestTransport.java:
68)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext.doFire(
AbstractRequestContext.java:1015)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext.fire(Ab
stractRequestContext.java:537)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
com.google.web.bindery.requestfactory.shared.impl.AbstractRequest.fire(AbstractR
equest.java:55)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
com.google.web.bindery.requestfactory.shared.impl.AbstractRequest.fire(AbstractR
equest.java:60)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
com.coolbeans.textify.DeviceRegistrar.registerOrUnregister(DeviceRegistrar.java:
69)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
com.coolbeans.textify.C2DMReceiver.onRegistered(C2DMReceiver.java:47)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
com.google.android.c2dm.C2DMBaseReceiver.handleRegistration(C2DMBaseReceiver.jav
a:191)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
com.google.android.c2dm.C2DMBaseReceiver.onHandleIntent(C2DMBaseReceiver.java:11
0)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
android.os.Handler.dispatchMessage(Handler.java:99)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
android.os.Looper.loop(Looper.java:130)
05-22 13:58:04.563: ERROR/AndroidRuntime(16803):     at 
android.os.HandlerThread.run(HandlerThread.java:60)

Original issue reported on code.google.com by matthew....@gmail.com on 22 May 2011 at 4:25

GoogleCodeExporter commented 9 years ago
Steps to reproduce:
1. Go to big daddy application on android 
2. Menu -> Register
3. Authorize registration for google acocunt

Original comment by matthew....@gmail.com on 22 May 2011 at 4:31

GoogleCodeExporter commented 9 years ago
Same error on Droid x.

Original comment by patjacks...@gmail.com on 5 Jun 2011 at 8:37

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I had a similar issue when using the "Say Hello" button before registering. The 
issue was the auth cookie wasn't being sent as part of the request, and the 
server was rejecting the call responding with an html login screen (first 
character '<').

If you download gwt-2.4Beta and add gwt-user.jar as source (it has compiled and 
source files)  for requestfactory-client.jar you can breakpoint JsonSplittable 
line 79 and see what the parser is barfing on.

Original comment by andybry...@gmail.com on 11 Jun 2011 at 8:08

GoogleCodeExporter commented 9 years ago
Actually source is included with the project in the lib directory. It's just 
not hooked up by default.

Original comment by andybry...@gmail.com on 11 Jun 2011 at 8:15

GoogleCodeExporter commented 9 years ago
Excuse the newbie question, but how do you hook up the jar file so you can
view the source?

Original comment by patjacks...@gmail.com on 13 Jun 2011 at 1:40

GoogleCodeExporter commented 9 years ago
Besides the demo on stage, has anyone gotten this to work?

Original comment by vinblau on 18 Jun 2011 at 8:40

GoogleCodeExporter commented 9 years ago
I've spent several weeks trying to fix this with no luck, and has been 
extremely aggravating. This is not an issue specifically with the cloud tasks 
app, but rather an issue with the generated source code for App Engine 
Connected Android Projects.

This worked for the demo at Google IO simply because they were locally 
debugging the android project. I don't fully understand why, but when you are 
debugging locally, to register for c2dm the the application doesn't actually 
require the Authentication Cookie. If you look inside of AccountsActivity.java, 
the getAuthCookie method (with cloud tasks, or just a default generated App 
Engine Connected Android Project), what happens is before your applications 
actually sends out the registration request to c2dm, the android application 
first contacts it's designated app engine server sending it the authentication 
token, so that it can get back an authentication cookie, that it can send and 
use to register for c2dm. The problem is that when we contact the AppEngine 
server that we have hosted, the response that we get back has a 500 Internal 
Server Error, and as such, an authentication cookie isn't included with the 
response. we submit a value of null for the cookie, and so when we ultimately 
try and register for c2dm with that null cookie, we lack the credentials to 
register, and receive back an html page that we can't parse.

I've been trying to figure out why the request is failing on the app engine 
server without much luck. I've been using the Droid X by the way. Please let me 
know if anyone has gotten this to work somehow.

Original comment by spierce7@gmail.com on 19 Jun 2011 at 8:02

GoogleCodeExporter commented 9 years ago
I had this problem, and debugging it found I had the same issue as spierce7. To 
resolve it, in AccountsActivity.java, the authToken returned in my 
authTokenBundle needed to be invalidated -  mgr.invalidateAuthToken(acct.type, 
authToken).

It's explained nicely on this page ,  funnily enough with the word "Important" 
next to it :) 
http://developer.android.com/reference/android/accounts/AccountManager.html

Original comment by akohlh...@gmail.com on 9 Jul 2011 at 9:17

GoogleCodeExporter commented 9 years ago
Hi

In AccountsActivity, mgr.invalidateAuthToken(account.type, authToken); is 
already being called inside the run() method in the register(final String 
accountName) method, after the getAuthToken(future); call. I still get the 
Internal Server Error, any clue?

Original comment by ManuelM...@gmail.com on 14 Sep 2011 at 7:08