Here's what I've got. I think it is configured properly from a rabbitmq point of view. The difference between this and make test (which works) is that i'm hosting the html and js on apache, and i'm using an absolute URL for the rabbitmq json-rpc service. I may have entered the wrong values in the various URI variables in the javascript-- not really sure.<div>
<div><br></div><div><div>~ > /usr/local/sbin/rabbitmqctl status</div><div>Status of node rabbit@H5Pro ...</div><div>[{running_applications,</div><div> [{rabbit_jsonrpc_channel,"RabbitMQ JSON-RPC Channels","0.01"},</div>
<div> {rabbit,"RabbitMQ","1.7.2"},</div><div> {os_mon,"CPO CXC 138 46","2.2.5"},</div><div> {sasl,"SASL CXC 138 11","2.1.9"},</div><div> {rabbit_jsonrpc,"Rabbit JSON-RPC","0.01"},</div>
<div> {rfc4627_jsonrpc,"JSON RPC Service","0.01"},</div><div> {rabbit_mochiweb,"RabbitMQ Mochiweb Embedding","0.01"},</div><div> {mochiweb,"MochiMedia Web Server","0.01"},</div>
<div> {mnesia,"MNESIA CXC 138 12","4.4.13"},</div><div> {stdlib,"ERTS CXC 138 10","1.16.5"},</div><div> {kernel,"ERTS CXC 138 10","2.13.5"}]},</div>
<div> {nodes,[rabbit@H5Pro]},</div><div> {running_nodes,[rabbit@H5Pro]}]</div><div>...done.</div><div><br></div><div>thanks again,</div><div>bp</div><br><div class="gmail_quote">On Thu, Apr 22, 2010 at 11:55 PM, Tony Garnock-Jones <span dir="ltr"><<a href="mailto:tonyg@lshift.net">tonyg@lshift.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Not *quite* what is required, but a good start, is to run "rabbitmqctl status".<br>
For instance, on my dev instance of RabbitMQ, I get:<br>
<br>
~/dev/rabbitmq-umbrella/rabbitmq-server$ ./scripts/rabbitmqctl status<br>
Status of node rabbit@walk ...<br>
[{running_applications,<br>
[{rabbit_lvc_plugin,"RabbitMQ last-value cache exchange plugin","0.01"},<br>
{rabbit_script_exchange,"RabbitMQ Script Exchange Plugin","0.01"},<br>
<div class="im"> {rfc4627_jsonrpc,"JSON RPC Service","0.01"},<br>
</div> {rabbitmq_smtp_server,"RabbitMQ SMTP Server","0.0"},<br>
{rabbithub,"rabbithub","0.0.1"},<br>
{crypto,"CRYPTO version 1","1.6.4"},<br>
<div class="im"> {mochiweb,"MochiMedia Web Server","0.01"},<br>
</div> {rabbit_stomp,"Embedded Rabbit Stomp Adapter","0.01"},<br>
{rabbit,"RabbitMQ","%%VSN%%"},<br>
<div class="im"> {rabbit_mochiweb,"RabbitMQ Mochiweb Embedding","0.01"},<br>
</div><div class="im"> {mnesia,"MNESIA CXC 138 12","4.4.13"},<br>
</div><div class="im"> {os_mon,"CPO CXC 138 46","2.2.5"},<br>
{sasl,"SASL CXC 138 11","2.1.9"},<br>
</div> {erlang_smtp,"Erlang POP3 and SMTP server library code","0.0"},<br>
<div class="im"> {stdlib,"ERTS CXC 138 10","1.16.5"},<br>
{kernel,"ERTS CXC 138 10","2.13.5"}]},<br>
</div> {nodes,[rabbit@walk]},<br>
{running_nodes,[rabbit@walk]}]<br>
...done.<br>
<br>
<br>
You'll see the jsonrpc-channel app in the list, if it's installed and<br>
initialised correctly.<br>
<br>
Cheers,<br>
Tony<br>
<div class="im"><br>
<br>
Benjamin Polidore wrote:<br>
> hey, i can't seem to get past this. i'm probably doing something silly,<br>
> but i keep getting:<br>
><br>
> {"version":"1.1","id":null,"error":{"name":"JSONRPCError","code":404,"message":"Procedure not found","error":["<a href="http://h5pro.local:55672/rpc/rabbitmq" target="_blank">http://h5pro.local:55672/rpc/rabbitmq</a>",""]}}<br>
><br>
> when i run the test.js from my mac's apache server. is there a dead simple way to test that jsonrpc-channel is working when it's running as a plugin?<br>
><br>
><br>
> On Sun, Apr 18, 2010 at 2:31 PM, Benjamin Polidore <<a href="mailto:polidore@gmail.com">polidore@gmail.com</a><br>
</div><div class="im">> <mailto:<a href="mailto:polidore@gmail.com">polidore@gmail.com</a>>> wrote:<br>
><br>
> Thanks, Paul. I decided not to mess with the source code, and I'm<br>
> just using OS X's built in apache for my static files.<br>
><br>
> Now I'm getting a different problem. I modified the test program to<br>
> work in this new context by changing the paths for loading the<br>
> javascripts and changing the urls in rabbitmq.js:<br>
><br>
> factoryServiceUrl: *"<a href="http://h5pro.local:55672/rpc/rabbitmq" target="_blank">http://h5pro.local:55672/rpc/rabbitmq</a>",*<br>
> rpcServiceUrlBase*: "<a href="http://h5pro.local:55672/rpc/" target="_blank">http://h5pro.local:55672/rpc/</a>",*<br>
><br>
> and in test.js:<br>
><br>
> var channelFactory = new<br>
> JsonRpc.Service("*<a href="http://h5pro.local:55672/rpc/rabbitmq" target="_blank">http://h5pro.local:55672/rpc/rabbitmq</a>", *<br>
><br>
> But it doesn't work. When I do an ngrep on the traffic going<br>
> between my js and mochiweb, I get:<br>
><br>
</div>> T <a href="http://10.0.1.3:60988" target="_blank">10.0.1.3:60988</a> <<a href="http://10.0.1.3:60988" target="_blank">http://10.0.1.3:60988</a>> -> <a href="http://10.0.1.3:55672" target="_blank">10.0.1.3:55672</a><br>
> <<a href="http://10.0.1.3:55672" target="_blank">http://10.0.1.3:55672</a>> [AP]<br>
<div class="im">> OPTIONS /rpc/rabbitmq HTTP/1.1..Host:<br>
> h5pro.local:55672..Connection: keep-alive..User-Agent: Mozilla/5.0<br>
> (Macintosh; U; Intel Mac OS X 10_6_3; e<br>
> n-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.9<br>
> Safari/533.4..Referer:<br>
> <a href="http://h5pro.local/~bp/rabbitTest/www-examples/test/..Access" target="_blank">http://h5pro.local/~bp/rabbitTest/www-examples/test/..Access</a><br>
> -Control-Request-Method: POST..Origin:<br>
> <a href="http://h5pro.local." target="_blank">http://h5pro.local.</a>.Access-Control-Request-Headers:<br>
> X-Requested-With, Content-Type, Accept..Accept: */*..<br>
> Accept-Encoding: gzip,deflate,sdch..Accept-Language:<br>
> en-US,en;q=0.8..Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3....<br>
><br>
> ##<br>
</div>> T <a href="http://10.0.1.3:55672" target="_blank">10.0.1.3:55672</a> <<a href="http://10.0.1.3:55672" target="_blank">http://10.0.1.3:55672</a>> -> <a href="http://10.0.1.3:60988" target="_blank">10.0.1.3:60988</a><br>
> <<a href="http://10.0.1.3:60988" target="_blank">http://10.0.1.3:60988</a>> [AP]<br>
<div class="im">> HTTP/1.1 200 OK..Server: MochiWeb/1.0 (Any of you quaids got a<br>
> smint?)..Date: Sun, 18 Apr 2010 18:27:48 GMT..Content-type:<br>
> text/plain..Content-L<br>
> ength: 155....<br>
><br>
><br>
> ##<br>
</div>> T <a href="http://10.0.1.3:55672" target="_blank">10.0.1.3:55672</a> <<a href="http://10.0.1.3:55672" target="_blank">http://10.0.1.3:55672</a>> -> <a href="http://10.0.1.3:60988" target="_blank">10.0.1.3:60988</a><br>
> <<a href="http://10.0.1.3:60988" target="_blank">http://10.0.1.3:60988</a>> [AP]<br>
<div class="im">> {*"version":"1.1","id":null,"error":{"name":"JSONRPCError","code":404,"message":"Procedure<br>
> not found","error":["<a href="http://h5pro.local:55672/rpc/rabb" target="_blank">http://h5pro.local:55672/rpc/rabb</a> itmq",""]}} *<br>
> *<br>
> *<br>
> *Thoughts? *<br>
> *<br>
> Thanks,<br>
> bp *<br>
><br>
> On Sat, Apr 17, 2010 at 6:46 PM, Paul Jones <<a href="mailto:pauljones23@gmail.com">pauljones23@gmail.com</a><br>
</div><div><div></div><div class="h5">> <mailto:<a href="mailto:pauljones23@gmail.com">pauljones23@gmail.com</a>>> wrote:<br>
><br>
> Hi Benjamin,<br>
><br>
> In the production mode, mochiweb doesn't really have a docroot<br>
> setup. /rabbitmq_lib will serve the files in priv/www, but that<br>
> is as far as it goes.<br>
><br>
> However... if you want to serve some other files then you could<br>
> always use code similar to what the test mode does to make it<br>
> happen. For example, if you were to add:<br>
><br>
> Handler = rabbit_mochiweb:static_context_handler("", ?MODULE,<br>
> "priv/mydocroot"),<br>
> ok = rabbit_mochiweb:register_global_handler(Handler),<br>
><br>
> after the line:<br>
> rabbit_mochiweb:register_static_context(ContextRoot, ?MODULE,<br>
> "priv/www")<br>
><br>
> in src/rabbit_jsonrpc_channel_app.erl, then once you've<br>
> installed the plugin into Rabbit, any file put into<br>
> priv/plugins/rabbitmq-jsonrpc-channel/priv/mydocroot should be<br>
> served from the root context of mochiweb.<br>
><br>
> BTW, I've just noticed a bug in the packaging of the<br>
> jsonrpc-channel plugin such that if you do run that plugin by<br>
> installing it via a .ez, you'll need to copy the priv/www<br>
> directory into priv/plugins/rabbitmq-jsonrpc-channel/priv/www<br>
> (otherwise libraries such as rabbitmq.js won't be available).<br>
><br>
> Thanks,<br>
> Paul.<br>
><br>
><br>
> On Sat, Apr 17, 2010 at 11:29 PM, Benjamin Polidore<br>
</div></div><div><div></div><div class="h5">> <<a href="mailto:polidore@gmail.com">polidore@gmail.com</a> <mailto:<a href="mailto:polidore@gmail.com">polidore@gmail.com</a>>> wrote:<br>
><br>
> Hey, paul, I installed all the dependencies to<br>
> rabbitmq-jsonrpc-channel (see below).<br>
><br>
> I see that you add a little context in test mode.<br>
> Basically, I was hoping to use the plugin to host my HTML<br>
> and javascript in dev mode so I don't have to run another<br>
> webserver on my laptop. I prefer to run rabbitmq in<br>
> "production" mode on my laptop, and I was curious what<br>
> mochiweb thinks the docroot is in this mode.<br>
><br>
> [{running_applications,<br>
> [{rabbit_jsonrpc_channel,"RabbitMQ JSON-RPC<br>
> Channels","0.01"},<br>
> {rabbit,"RabbitMQ","1.7.2"},<br>
> {os_mon,"CPO CXC 138 46","2.2.5"},<br>
> {sasl,"SASL CXC 138 11","2.1.9"},<br>
> {rabbit_jsonrpc,"Rabbit JSON-RPC","0.01"},<br>
> {rfc4627_jsonrpc,"JSON RPC Service","0.01"},<br>
> {rabbit_mochiweb,"RabbitMQ Mochiweb Embedding","0.01"},<br>
> {mochiweb,"MochiMedia Web Server","0.01"},<br>
> {mnesia,"MNESIA CXC 138 12","4.4.13"},<br>
> {stdlib,"ERTS CXC 138 10","1.16.5"},<br>
> {kernel,"ERTS CXC 138 10","2.13.5"}]},<br>
> {nodes,[rabbit@H5Pro]},<br>
> {running_nodes,[rabbit@H5Pro]}]<br>
> ...done.<br>
><br>
><br>
> On Sat, Apr 17, 2010 at 4:11 PM, Paul Jones<br>
</div></div><div class="im">> <<a href="mailto:pauljones23@gmail.com">pauljones23@gmail.com</a> <mailto:<a href="mailto:pauljones23@gmail.com">pauljones23@gmail.com</a>>> wrote:<br>
><br>
> Hi Benjamin,<br>
><br>
> Which plugins have you installed into RabbitMQ? The<br>
> mochiweb plugin alone simply embeds a webserver - you'll<br>
> need to install rabbitmq-jsonrpc and<br>
> rabbitmq-jsonrpc-channel to get the JSON services.<br>
><br>
> If you have done this, then you might be hitting the<br>
> fact that when running under test, an additional context<br>
> is installed under the root that provides all the<br>
> various test examples. We don't activate this in the<br>
> "production" mode, since we don't expect you'll want<br>
> them in a real deployment. The scripts for doing<br>
> JSON-RPC are still there though - under /rabbitmq_lib<br>
> (the scripts that are made available via this can be<br>
> found on the filesystem in priv/www).<br>
><br>
> I hope this answers your question.<br>
><br>
> Cheers,<br>
> Paul<br>
><br>
> On Sat, Apr 17, 2010 at 8:28 PM, Benjamin Polidore<br>
</div><div class="im">> <<a href="mailto:polidore@gmail.com">polidore@gmail.com</a> <mailto:<a href="mailto:polidore@gmail.com">polidore@gmail.com</a>>> wrote:<br>
><br>
> hi, i'm trying to use the json-channel plugin, and<br>
> it runs ok when i do make test, but it doesn't seem<br>
> to work when i try to start up my broker. the port<br>
> is open, but everything returns 404. what is<br>
> mochiweb using as a docroot when I run it outside<br>
> make test? sorry if this is obvious, but i've been<br>
> struggling with it for a couple hours.<br>
><br>
> thanks,<br>
> bp<br>
><br>
> _______________________________________________<br>
> rabbitmq-discuss mailing list<br>
> <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
</div>> <mailto:<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a>><br>
<div class="im">> <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>
><br>
><br>
><br>
><br>
><br>
><br>
</div>> ------------------------------------------------------------------------<br>
<div><div></div><div class="h5">><br>
> _______________________________________________<br>
> rabbitmq-discuss mailing list<br>
> <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">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>
</div></div></blockquote></div><br></div></div>