No, I didn't use REST, I have /social/data in the url.
--- On Fri, 6/6/08, Chris Chabot <[EMAIL PROTECTED]> wrote:
From: Chris Chabot <[EMAIL PROTECTED]>
Subject: Re: open social sample container error on php shindig server
To: [email protected]
Date: Friday, June 6, 2008, 9:20 AM
I tried to tell you this earlier already: Just changing the URL does
not change the protocol
/social/data talks 'JSON'
/social/rest -doesn't exist yet in php-
So just changing an URL doesn't make it speak another language (REST
instead of JSON), and that's where your error comes from. Your doing a
REST request to a JSON handler, putting a square in a circle so to
speak.. it just don't work that way.
I think for now your better of sticking to the javascript/container/
sample*.html files, or check out partuza (http://code.google.com/p/partuza
) if you need a sample container.
-- Chris
On Jun 6, 2008, at 4:12 PM, xin zhang wrote:
> ok, I changed the code in SampleContainer.html to
> &nbsp;
> var socialDataPath = document.location.protocol + "//" +
> document.location.host
> &nbsp;&nbsp;&nbsp; +
"/shindig/php/social/data/samplecontainer/";
>
> But this time I got the following error:
>
> &lt;br /&gt;&lt;b&gt;Fatal error&lt;/
b&gt;:
Uncaught exception
> 'Exception' with message 'Invalid request JSON' in
/Library/
> WebServer/Documents/shindig/php/src/socialdata/http/
> GadgetDataServlet.php:80Stack trace:#0 /Library/WebServer/
Documents/
> shindig/php/index.php(86): GadgetDataServlet-
&amp;gt;doPost()#1
> {main} thrown in
&lt;b&gt;/Library/WebServer/Documents/shindig/php/
> src/socialdata/http/GadgetDataServlet.php&lt;/b&gt; on
line
&lt;b&gt;
> 80&lt;/b&gt;&lt;br /&gt;
>
> It seems it did make request to the servlet.
>
> What is the problem here?
>
> Thanks
>
> --- On Fri, 6/6/08, Ram Sharma
&lt;[EMAIL PROTECTED]&gt;
wrote:
> From: Ram Sharma &lt;[EMAIL PROTECTED]&gt;
> Subject: Re: open social sample container error on php shindig
server
> To: [email protected]
> Date: Friday, June 6, 2008, 6:21 AM
>
> So, We should have a comment in SampleContainer.html code for PHP
> Shindig
> users that Please change /social/rest to /social/data/ till we
have
> RESTful
> api support in PHP Shindig.
>
> On Fri, Jun 6, 2008 at 4:45 PM, Chris Chabot
> &lt;[EMAIL PROTECTED]&gt; wrote:
>
> &gt; I guess the sample container assumes your using the
RESTful
> api, which
> &gt; doesn't exist yet in the PHP version.
> &gt;
> &gt; On Fri, 2008-06-06 at 15:08 +0530, Ram Sharma wrote:
> &gt; &gt; Hi Chirs,
> &gt; &gt;
> &gt; &gt; I wrote that as a bug because in
samplecontiner.html
> contains the
> code
> &gt; &gt;
> &gt; &gt; var socialDataPath =
document.location.protocol +
"//" +
> &gt; &gt; document.location.host
> &gt; &gt; + "/social/data/samplecontainer/";
> &gt; &gt;
> &gt; &gt; so it will try to find '/social/data/' and
throws error
> &gt; &gt;
> &gt; &gt; that's why had have that change in URL mapping.
> &gt; &gt;
> &gt; &gt; - Ram
> &gt; &gt;
> &gt; &gt; On Fri, Jun 6, 2008 at 3:04 PM, Ram Sharma
> &lt;[EMAIL PROTECTED]&gt;
> &gt; wrote:
> &gt; &gt;
> &gt; &gt; &gt; Hi Chris,
> &gt; &gt; &gt;
> &gt; &gt; &gt; That might be the case, But if don't
change
the
> mapping then
> sample
> &gt; &gt; &gt; container doesn't work like Xin has
asked.
Wha to do
> in that
> case.
> &gt; &gt; &gt;
> &gt; &gt; &gt;
> &gt; &gt; &gt; On Fri, Jun 6, 2008 at 2:14 PM,
Chris Chabot
> &lt;[EMAIL PROTECTED]&gt;
> &gt; wrote:
> &gt; &gt; &gt;
> &gt; &gt; &gt;&gt; Hey Ram,
> &gt; &gt; &gt;&gt;
> &gt; &gt; &gt;&gt; Just to prevent potential
confusion...
thats not
> a bug.
> &gt; &gt; &gt;&gt;
> &gt; &gt; &gt;&gt; The PHP version of shindig
still uses
the
> original JSON
> based wire
> &gt; format
> &gt; &gt; &gt;&gt; which lives under /social/
data. We are
working on
> making the
> RESTful
> &gt; &gt; &gt;&gt; interface too, and once
that's done
that will
> live under
> /social/rest.
> &gt; &gt; &gt;&gt;
> &gt; &gt; &gt;&gt; However just changing the
URL mapping
of the JSON
> wire
> format handler,
> &gt; &gt; &gt;&gt; doesn't make it into a restful
interface it will
> only
> break everything
> &gt; :-)
> &gt; &gt; &gt;&gt;
> &gt; &gt; &gt;&gt; -- Chris
> &gt; &gt; &gt;&gt;
> &gt; &gt; &gt;&gt;
> &gt; &gt; &gt;&gt; On Jun 6, 2008, at 8:27 AM,
Ram Sharma
wrote:
> &gt; &gt; &gt;&gt;
> &gt; &gt; &gt;&gt; Hi,
> &gt; &gt; &gt;&gt;&gt; There is a bug left
in recent
releases.
> Index.php has
> some
> &gt; definitions
> &gt; &gt; &gt;&gt;&gt; for
> &gt; &gt; &gt;&gt;&gt; the incoming server
requests.
> &gt; &gt; &gt;&gt;&gt; the code which is
there
> &gt; &gt; &gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt; $servletMap = array(
> &gt; &gt; &gt;&gt;&gt;
Config::get('web_prefix') .
> '/gadgets/files' =&gt; 'FilesServlet',
> &gt; &gt; &gt;&gt;&gt;
Config::get('web_prefix') .
> '/gadgets/js' =&gt; 'JsServlet',
> &gt; &gt; &gt;&gt;&gt;
Config::get('web_prefix') .
> '/gadgets/proxy' =&gt; 'ProxyServlet',
> &gt; &gt; &gt;&gt;&gt;
Config::get('web_prefix') .
> '/gadgets/ifr' =&gt;
> &gt; &gt; &gt;&gt;&gt;
'GadgetRenderingServlet',
> &gt; &gt; &gt;&gt;&gt;
Config::get('web_prefix') .
> '/gadgets/metadata' =&gt; 'JsonRpcServlet',
> &gt; &gt; &gt;&gt;&gt;
Config::get('web_prefix') .
> '/social/data' =&gt;
> &gt; 'GadgetDataServlet',
> &gt; &gt; &gt;&gt;&gt;
Config::get('web_prefix') .
> '/public.crt' =&gt; 'CertServlet'
> &gt; &gt; &gt;&gt;&gt; );
> &gt; &gt; &gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt; you will have to
change
> &gt; &gt; &gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;
Config::get('web_prefix') .
> '/social/data' =&gt;
> &gt; 'GadgetDataServlet',
> &gt; &gt; &gt;&gt;&gt; to
> &gt; &gt; &gt;&gt;&gt;
Config::get('web_prefix') .
> '/social/rest' =&gt;
> &gt; 'GadgetDataServlet',
> &gt; &gt; &gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt; I think it will work
for you.
> &gt; &gt; &gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt; - Ram Sharma
> &gt; &gt; &gt;&gt;&gt; Impetus Infotech
India Pvt Ltd
> &gt; &gt; &gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt; On Fri, Jun 6, 2008
at 12:07
AM, xin zhang
> &lt;[EMAIL PROTECTED]&gt;
> &gt; wrote:
> &gt; &gt; &gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt; Hi,
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt; When I run
the open
social sample container
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt;
>
hhttp://localhost/shindig/php/gadgets/files/samplecontainer/samplecontainer.html
> ,
> &gt; &gt; &gt;&gt;&gt;&gt; I got "The
request
to the server caused an
> error" caused by
> &gt; &gt; &gt;&gt;&gt;&gt; POST
> &gt; http://localhost/shindig/php/social/rest/samplecontainer/setstate
> &gt; &gt; &gt;&gt;&gt;&gt; 404
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt; It is ok if
start java
shindig server
> with mvn
> -Prun.
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt; Can anyone
help me
this?
> &gt; &gt; &gt;&gt;&gt;&gt; Thanks
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt;
> &gt; &gt; &gt;&gt;&gt; --
> &gt; &gt; &gt;&gt;&gt; Ram Sharma
> &gt; &gt; &gt;&gt;&gt; Software Engineer
> &gt; &gt; &gt;&gt;&gt; Impetus Infotech
(India) Pvt
Ltd
> &gt; &gt; &gt;&gt;&gt; Indore
> &gt; &gt; &gt;&gt;&gt;
> &gt; &gt; &gt;&gt;
> &gt; &gt; &gt;&gt;
> &gt; &gt; &gt;
> &gt; &gt; &gt;
> &gt; &gt; &gt; --
> &gt; &gt; &gt; Ram Sharma
> &gt; &gt; &gt; Software Engineer
> &gt; &gt; &gt; Impetus Infotech (India) Pvt Ltd
> &gt; &gt; &gt; Indore
> &gt; &gt; &gt;
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;
> &gt;
> &gt;
>
>
> --
> Ram Sharma
> Software Engineer
> Impetus Infotech (India) Pvt Ltd
> Indore
>
>