Re: [Erlangweb-users] Problems in step1 of tutorial
Brought to you by:
etcerlangweb,
paulgray
|
From: Jeffm <je...@gh...> - 2010-03-19 05:33:18
|
Alright folks I'm an idiot. I must have started a copy in the
background with the bin/start script and it was the one answering
requests. It wasn't until I tried the trace that you suggested below
that I notice that I wasn't getting requests to the instance I was
looking at. Thanks.
I did notice one thing while debugging. If you don't have the brackets
in the regexp in the dispatch.conf file balanced and attempt to start
erlang-web, say via bin/start_interactive, you get something like
=PROGRESS REPORT==== 19-Mar-2010::11:58:36 ===
application: inets
started_at: nonode@nohost
{"init terminating in
do_boot",{badarg,[{e_conf,dbms,0},{e_db,start,0},{init,start_it,1},{init,start_em,1}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
The first time this occurred there was a list of integers in the
erl_crash.dump which happened to decode to an erlang error. This can
also be seen in the log messages on screen once you know what your
looking for but can still be hard to see.
For example,
exception exit: {bad_return,
{{eptic,start,[normal,[]]},
{'EXIT',
{{badmatch,{error,{"unmatched
parentheses",24}}},
[{e_dispatcher,divide,3},
{e_dispatcher,install,0},
{lists,foreach,2},
{eptic,start_link,0},
{application_master,start_it_old,4}]}}}}
If possible I'd like to put in a feature request that this error be
caught and a meaningful error displayed.
Jeff.
On 19/03/10 12:18 AM, Roberto Aloi wrote:
> You might want to debug what's happening behind the scenes.
> In Erlang, it's extremely easy to trace functions, so that you can check
> which function has been called, when, and what it's returning.
>
> In your case, you might be interested in the function:
> e_dispatcher:dispatch/1
>
> Tracing functions will help you (a lot!) in understanding how the whole
> Erlang Web framework works.
>
> For more information on how to trace Erlang functions, have a look to
> this quick reference:
> http://aloiroberto.wordpress.com/2009/02/23/tracing-erlang-functions/
>
> Regards,
>
> Roberto Aloi
>
>
|