On 15 Nov 2012, Martin Hoeller wrote: > On 15 Nov 2012, Martin Hoeller wrote: > > On 14 Nov 2012, Ryan Baxter wrote: > > > > > If I had to guess that error is coming from RpcServlet.process. But it > > > looks like you would only get that is your JSON was invalid. I ran the > > > JSON in your email through a validator and it looks correct, so I am not > > > really sure. You might want to set a breakpoint in RpcServlet.process and > > > see if you see anything else. > > > > An exception is thrown in the first line of the RpcServlet.process method: > > > > JSONObject req = new JSONObject(body); > > > > The message of the exception says > > > > org.json.JSONException: A JSONObject text must begin with '{' at > > character 1 of [{"method":"gadgets.metadata","id":"gadgets.metadata", > > "params" ... "groupId":"@self"}}] > > I did some more debugging and according to Firebug, the working > example shipped with Shindig sends a request that is almost identical! > > So I'm confused why the RpcServlet can interpret the posted data > one time while it cannot handle it another time with no significant > change. > > Both requests have JSON data starting with '[{"method":...'. > > I'm still debuging and post back when I know more...
Ok, found the cause of the problem: the failing request was directed to the wrong Servlet. It seems I was mixing up configurations from the various examples I found and thus the request went to the RpcServlet instead of to the JsonRpcsServlet. Thanks for your help anyway, - martin
signature.asc
Description: PGP signature