shindig-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phillip Rhodes <>
Subject Weird "Malformed JSON" problem with Shindig
Date Thu, 23 Dec 2010 08:16:53 GMT
Hi guys, hoping somebody can help me with a little problem I'm having with

What I have is this:  I've built Shindig from SVN, using the latest code
from trunk.  I've deployed to Tomcat 6.0.26, with Shindig
as the ROOT webapp.  I can browse to <
http://localhost:8080/container/sample1.html> and see both gadgets rendered
and working.  So, Shindig is fundamentally functional.  Ok...

Now here's where it gets weird.  I'm trying to integrate Shindig into my
application, so I setup a page that basically
mimics the content of sample1.html.  It's a Grails app, and is deployed to
the same Tomcat instance, but in a context
of 'quoddy2/'.  I'm reaching the page through a URL of <
http://localhost:8080/quoddy2/opensocial> and at runtime the
generated HTML includes this bit, copied almost verbatim from sample1.html:

		<!-- default container look and feel -->
		<link rel="stylesheet" href="/quoddy2/css/gadgets.css
		<script type="text/javascript"
		<script type="text/javascript">
			var specUrl0 = '';
			var specUrl1 = '';

			// This container lays out and renders gadgets itself.

			function renderGadgets() {
  			var gadget0 = shindig.container.createGadget({specUrl: specUrl0});
  			var gadget1 = shindig.container.createGadget({specUrl: specUrl1});

      		['gadget-chrome-x', 'gadget-chrome-y']);

the <body onload="">  bit is there, as are the two divs for the
gadgets.  But, no gadget is rendered.  I am getting back a response

from a call to /gadgets/metadata of "Malformed JSON response."
Debugging into the RpcServlet, I've found that, sure enough, the JSON

comes in is different depending on which URL I used.  In the working
case, (sample1.html from the actual Shindig deployment) I get (for the
first gadget):


But when I load my page, the JSON that is sent looks like:

\"\", \"moduleId\":

and the JSON parser complains that "gadgets is not a valid JSON array."

Sooo... there seems to be something very subtle going on here, that I'm
missing.  Why would I get the JSON with the escaped quotes in one case, when
everything else seems to be
essentially the same?

I'm not much a browser / javascript / client-side guy, so please forgive my
ignorance if this is something obvious!


Phillip Rhodes
Fogbeam Labs

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message