I'm using Objectify. Problem was caused by:
ofy().save().entities(players, user);
Obviously I cannot provide collection and single entity at once, sot I fixed it with:
ofy().save().entities(players);
ofy().save().entity(user);
Question
All of the sudden, previously working Google App Engine (JAVA) endpoint started to throw this at me:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "java.lang.IllegalArgumentException: No class 'com.sun.proxy.$Proxy33' was registered",
"reason" : "badRequest"
} ],
"message" : "java.lang.IllegalArgumentException: No class 'com.sun.proxy.$Proxy33' was registered"
}
I'm executing endpoint method from android app like this:
CollectionResponseRPlayer response = endpoint.checkResult(gameId, answer, hash).execute();
gameId
is Long
, and the answer
and hash
are Strings
I stopped on execute()
line to preview what values are passed in gameId
, answer
and hash
to figure why could it be the bad request. They are as follows:
gameId = 8113932860298394396
answer = "KCMR"
hash = "D3C04148ACD9A166E6DBD0268D76AC39CB6C7CEB4B056522522B3551EA28830AFGF129DD89AB4CD6F7375526C796DE031450DF32611ACA1FEB904AB4ECCC3D7CD15CB267F38F10BAE1951RTBBDD3EC110005D67ED82FC5C8EF4E74FF5363D858AFCCAE4EF0A078FB550E833FD527B54"
As you can see, hash field is pretty long one. Could it be the reason? I don't think it is. String in GAE is limited to 500 chars, and this hash barely 250. Also, I use the very same hash in every enpoint in may app, and this is the only one causing trouble...
Solution
I'm using Objectify. Problem was caused by:
ofy().save().entities(players, user);
Obviously I cannot provide collection and single entity at once, sot I fixed it with:
ofy().save().entities(players);
ofy().save().entity(user);