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.
On Wed, Nov 14, 2012 at 8:42 AM, Martin Hoeller <mar...@xss.co.at> wrote: > Hi! > > Some time ago I supplied a patch for a sample maven archetype [0]. Ryan > mentioned that the archetype should rather use the common container > instead of the actually used (obsolete) one. > > I'm now trying to convert the archetype to use shindigs common-container > but I'm having some troubles... > > I use this code for loading gadgets: > > CommonContainer.preloadGadgets(gadgetUrls, function(result) { > for (var gadgetURL in result) { > if(!result[gadgetURL].error) { > window.buildGadget(result, gadgetURL); > curId++; > } > } > }); > > However, preloadGadgets does an RPC call for gadget metadata and receives > a 400 BAD_REQUEST as result :( > The content of the response is "Malformed JSON request." > > Debuging showed that this was the data posted to the RPC Servlet: > > [ > {"method":"gadgets.metadata", > "id":"gadgets.metadata", > "params": > { > "ids": [ "http://localhost:8080/myFirstGadget.xml", > "http://www.labpixies.com/campaigns/todo/todo.xml"], > "fields": ["iframeUrls", > "modulePrefs.*", > "needsTokenRefresh", > "userPrefs.*", > "views.preferredHeight", > "views.preferredWidth", > "expireTimeMs", > "responseTimeMs", > "rpcServiceIds", > "tokenTTL"], > "language":"de", > "country":"DE", > "userId":"@viewer", > "groupId":"@self" > } > } > ] > > This data is generated by some shindig JavaScript code. Does anybody have > any idea what I'm doing wrong? I just want to use common-container to > display two gadgets. Can this be so hard? > > Many thanks in advance, > - martin > > [0] https://issues.apache.org/jira/browse/SHINDIG-1482 >