hey, i can&#39;t seem to get past this. i&#39;m probably doing something silly, but i keep getting:<div><br></div><div><span class="Apple-style-span" style="font-family: Times; font-size: medium; "><pre style="word-wrap: break-word; white-space: pre-wrap; ">
{&quot;version&quot;:&quot;1.1&quot;,&quot;id&quot;:null,&quot;error&quot;:{&quot;name&quot;:&quot;JSONRPCError&quot;,&quot;code&quot;:404,&quot;message&quot;:&quot;Procedure not found&quot;,&quot;error&quot;:[&quot;<a href="http://h5pro.local:55672/rpc/rabbitmq">http://h5pro.local:55672/rpc/rabbitmq</a>&quot;,&quot;&quot;]}}</pre>
<pre style="word-wrap: break-word; white-space: pre-wrap; ">when i run the test.js from my mac&#39;s apache server.  is there a dead simple way to test that jsonrpc-channel is working when it&#39;s running as a plugin?</pre>
</span><br><div class="gmail_quote">On Sun, Apr 18, 2010 at 2:31 PM, Benjamin Polidore <span dir="ltr">&lt;<a href="mailto:polidore@gmail.com">polidore@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Thanks, Paul. �I decided not to mess with the source code, and I&#39;m just using OS X&#39;s built in apache for my static files.�<div><br></div><div>Now I&#39;m getting a different problem. I modified the test program to work in this new context by changing the paths for loading the javascripts and changing the urls in rabbitmq.js:</div>

<div><div><br></div><div><span style="white-space:pre">        </span> � <font face="&#39;courier new&#39;, monospace">�factoryServiceUrl: </font><b><font face="&#39;courier new&#39;, monospace">&quot;<a href="http://h5pro.local:55672/rpc/rabbitmq" target="_blank">http://h5pro.local:55672/rpc/rabbitmq</a>&quot;,</font></b></div>

<div><font face="&#39;courier new&#39;, monospace"><span style="white-space:pre">�     </span>rpcServiceUrlBase</font><b><font face="&#39;courier new&#39;, monospace">: &quot;<a href="http://h5pro.local:55672/rpc/" target="_blank">http://h5pro.local:55672/rpc/</a>&quot;,</font></b></div>

<div><span style="white-space:pre">        </span>�� �</div></div><div>and in test.js:</div><div><br></div><div><div>�� �<font face="&#39;courier new&#39;, monospace">var channelFactory = new JsonRpc.Service(&quot;</font><b><font face="&#39;courier new&#39;, monospace"><a href="http://h5pro.local:55672/rpc/rabbitmq" target="_blank">http://h5pro.local:55672/rpc/rabbitmq</a>&quot;,�</font></b></div>

</div><div><br></div><div>But it doesn&#39;t work. �When I do an ngrep on the traffic going between my js and mochiweb, I get:</div><div><br></div><div><div>T<font face="&#39;courier new&#39;, monospace"> <a href="http://10.0.1.3:60988" target="_blank">10.0.1.3:60988</a> -&gt; <a href="http://10.0.1.3:55672" target="_blank">10.0.1.3:55672</a> [AP]</font></div>

<div><font face="&#39;courier new&#39;, monospace">��OPTIONS /rpc/rabbitmq HTTP/1.1..Host: h5pro.local:55672..Connection: keep-alive..User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; e</font></div>
<div><font face="&#39;courier new&#39;, monospace">��n-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.9 Safari/533.4..Referer: <a href="http://h5pro.local/~bp/rabbitTest/www-examples/test/..Access" target="_blank">http://h5pro.local/~bp/rabbitTest/www-examples/test/..Access</a></font></div>

<div><font face="&#39;courier new&#39;, monospace">��-Control-Request-Method: POST..Origin: <a href="http://h5pro.local." target="_blank">http://h5pro.local.</a>.Access-Control-Request-Headers: X-Requested-With, Content-Type, Accept..Accept: */*..</font></div>

<div><font face="&#39;courier new&#39;, monospace">��Accept-Encoding: gzip,deflate,sdch..Accept-Language: en-US,en;q=0.8..Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3.... � � � � � � � � � � � ��</font></div>
<div><font face="&#39;courier new&#39;, monospace">##</font></div><div><font face="&#39;courier new&#39;, monospace">T <a href="http://10.0.1.3:55672" target="_blank">10.0.1.3:55672</a> -&gt; <a href="http://10.0.1.3:60988" target="_blank">10.0.1.3:60988</a> [AP]</font></div>

<div><font face="&#39;courier new&#39;, monospace">��HTTP/1.1 200 OK..Server: MochiWeb/1.0 (Any of you quaids got a smint?)..Date: Sun, 18 Apr 2010 18:27:48 GMT..Content-type: text/plain..Content-L</font></div>
<div><font face="&#39;courier new&#39;, monospace">��ength: 155.... � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �</font></div>
<div><font face="&#39;courier new&#39;, monospace">##</font></div><div><font face="&#39;courier new&#39;, monospace">T <a href="http://10.0.1.3:55672" target="_blank">10.0.1.3:55672</a> -&gt; <a href="http://10.0.1.3:60988" target="_blank">10.0.1.3:60988</a> [AP]</font></div>

<div><font face="&#39;courier new&#39;, monospace">��{</font><b><font face="&#39;courier new&#39;, monospace">&quot;version&quot;:&quot;1.1&quot;,&quot;id&quot;:null,&quot;error&quot;:{&quot;name&quot;:&quot;JSONRPCError&quot;,&quot;code&quot;:404,&quot;message&quot;:&quot;</font><font color="#FF0000"><font face="&#39;courier new&#39;, monospace">Procedure not found&quot;</font></font><font face="&#39;courier new&#39;, monospace">,&quot;error&quot;:[&quot;<a href="http://h5pro.local:55672/rpc/rabb" target="_blank">http://h5pro.local:55672/rpc/rabb</a>��itmq&quot;,&quot;&quot;]}} � �</font></b></div>

<div><b><font face="&#39;courier new&#39;, monospace"><br></font></b></div><div><b><span style="font-weight:normal">Thoughts?</span><font face="&#39;courier new&#39;, monospace"> � � ��</font></b></div>
<div><b><font face="&#39;courier new&#39;, monospace"><font face="arial"><span style="font-weight:normal"><br>Thanks,<br></span></font></font><span style="font-weight:normal">bp</span> � � � �</b>�� � � �</div>
</div><div><div></div><div class="h5"><div><br><div class="gmail_quote">On Sat, Apr 17, 2010 at 6:46 PM, Paul Jones <span dir="ltr">&lt;<a href="mailto:pauljones23@gmail.com" target="_blank">pauljones23@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Benjamin,<br><br>In the production mode, mochiweb doesn&#39;t really have a docroot setup. /rabbitmq_lib will serve the files in priv/www, but that is as far as it goes.<br><br>However... if you want to serve some other files then you could always use code similar to what the test mode does to make it happen. For example, if you were to add:<br>


<br>Handler = rabbit_mochiweb:static_context_handler(&quot;&quot;, ?MODULE, &quot;priv/mydocroot&quot;),<br>ok = rabbit_mochiweb:register_global_handler(Handler),<br><br>after the line:<br>rabbit_mochiweb:register_static_context(ContextRoot, ?MODULE, &quot;priv/www&quot;)<br>


<br>in src/rabbit_jsonrpc_channel_app.erl, then once you&#39;ve installed the plugin into Rabbit, any file put into priv/plugins/rabbitmq-jsonrpc-channel/priv/mydocroot should be served from the root context of mochiweb.<br>


<br>BTW, I&#39;ve just noticed a bug in the packaging of the jsonrpc-channel plugin such that if you do run that plugin by installing it via a .ez, you&#39;ll need to copy the priv/www directory into priv/plugins/rabbitmq-jsonrpc-channel/priv/www (otherwise libraries such as rabbitmq.js won&#39;t be available).<br>


<br>Thanks,<br><font color="#888888">Paul.</font><div><div></div><div><br><br><div class="gmail_quote">On Sat, Apr 17, 2010 at 11:29 PM, Benjamin Polidore <span dir="ltr">&lt;<a href="mailto:polidore@gmail.com" target="_blank">polidore@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Hey, paul, I installed all the dependencies to rabbitmq-jsonrpc-channel (see below).<div><br></div><div>I see that you add a little context in test mode. �Basically, I was hoping to use the plugin to host my HTML and javascript in dev mode so I don&#39;t have to run another webserver on my laptop. �I prefer to run rabbitmq in &quot;production&quot; mode on my laptop, and I was curious what mochiweb thinks the docroot is in this mode.<br>



<div><br></div><div><div>[{running_applications,</div><div>�� � [{rabbit_jsonrpc_channel,&quot;RabbitMQ JSON-RPC Channels&quot;,&quot;0.01&quot;},</div><div>�� � �{rabbit,&quot;RabbitMQ&quot;,&quot;1.7.2&quot;},</div><div>



�� � �{os_mon,&quot;CPO �CXC 138 46&quot;,&quot;2.2.5&quot;},</div><div>�� � �{sasl,&quot;SASL �CXC 138 11&quot;,&quot;2.1.9&quot;},</div><div>�� � �{rabbit_jsonrpc,&quot;Rabbit JSON-RPC&quot;,&quot;0.01&quot;},</div><div>



�� � �{rfc4627_jsonrpc,&quot;JSON RPC Service&quot;,&quot;0.01&quot;},</div><div>�� � �{rabbit_mochiweb,&quot;RabbitMQ Mochiweb Embedding&quot;,&quot;0.01&quot;},</div><div>�� � �{mochiweb,&quot;MochiMedia Web Server&quot;,&quot;0.01&quot;},</div>



<div>�� � �{mnesia,&quot;MNESIA �CXC 138 12&quot;,&quot;4.4.13&quot;},</div><div>�� � �{stdlib,&quot;ERTS �CXC 138 10&quot;,&quot;1.16.5&quot;},</div><div>�� � �{kernel,&quot;ERTS �CXC 138 10&quot;,&quot;2.13.5&quot;}]},</div>



<div>�{nodes,[rabbit@H5Pro]},</div><div>�{running_nodes,[rabbit@H5Pro]}]</div><div>...done.</div><div><div></div><div><div><br></div><br><div class="gmail_quote">On Sat, Apr 17, 2010 at 4:11 PM, Paul Jones <span dir="ltr">&lt;<a href="mailto:pauljones23@gmail.com" target="_blank">pauljones23@gmail.com</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Hi Benjamin,<br><br>Which plugins have you installed into RabbitMQ? The mochiweb plugin alone simply embeds a webserver - you&#39;ll need to install rabbitmq-jsonrpc and rabbitmq-jsonrpc-channel to get the JSON services.<br>




<br>If you have done this, then you might be hitting the fact that when running under test, an additional context is installed under the root that provides all the various test examples. We don&#39;t activate this in the &quot;production&quot; mode, since we don&#39;t expect you&#39;ll want them in a real deployment. The scripts for doing JSON-RPC are still there though - under /rabbitmq_lib (the scripts that are made available via this can be found on the filesystem in priv/www).<br>




<br>I hope this answers your question.<br><br>Cheers,<br>Paul<br><br><div class="gmail_quote"><div><div></div><div>On Sat, Apr 17, 2010 at 8:28 PM, Benjamin Polidore <span dir="ltr">&lt;<a href="mailto:polidore@gmail.com" target="_blank">polidore@gmail.com</a>&gt;</span> wrote:<br>




</div></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div><div></div><div><span style="font-family:Consolas,&#39;Lucida Console&#39;,monospace,Verdana,sans-serif,&#39;sans serif&#39;;font-size:13px">hi, i&#39;m trying to use the json-channel plugin, and it runs ok when i do make test, but it doesn&#39;t seem to work when i try to start up my broker.<span>��</span>the port is open, but everything returns 404. �what is mochiweb using as a docroot when I run it outside make test? �sorry if this is obvious, but i&#39;ve been struggling with it for a couple hours.�</span><div>





<span style="font-family:Consolas,&#39;Lucida Console&#39;,monospace,Verdana,sans-serif,&#39;sans serif&#39;;font-size:13px"><br></span></div><div><span style="font-family:Consolas,&#39;Lucida Console&#39;,monospace,Verdana,sans-serif,&#39;sans serif&#39;;font-size:13px">thanks,</span></div>





<div><span style="font-family:Consolas,&#39;Lucida Console&#39;,monospace,Verdana,sans-serif,&#39;sans serif&#39;;font-size:13px">bp</span></div>
<br></div></div>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br></blockquote></div><br>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>