<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: small;">
<div>I'm building my first non-trivial Erlang application. I've gotten it working in the shell. Now I'm trying to build a release using rebar. "rebar generate" succeeds, but when I try to run the application I get the error below. I'm trying to follow these
 tutorials:</div>
<div><a href="http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades" target="_blank">http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades</a></div>
<div><a href="http://alancastro.org/2010/05/01/erlang-application-management-with-rebar.html" target="_blank">http://alancastro.org/2010/05/01/erlang-application-management-with-rebar.html</a></div>
<div><br>
</div>
<div>I have named both my application and my node "session". The error seems rather unhelpful, so any suggestions on how to debug are appreciated.</div>
<div><br>
</div>
<div>thanks,</div>
<div>Ransom</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>cocomo@ubuntu:~/dev/talko/service/session$ ./rel/session/bin/session console</div>
<div>Exec: /home/cocomo/dev/talko/service/session/rel/session/erts-5.9/bin/erlexec -boot /home/cocomo/dev/talko/service/session/rel/session/releases/1/session -mode embedded -config /home/cocomo/dev/talko/service/session/rel/session/releases/1/sys.config -args_file
 /home/cocomo/dev/talko/service/session/rel/session/releases/1/vm.args -- console</div>
<div>Root: /home/cocomo/dev/talko/service/session/rel/session</div>
<div>Erlang R15B (erts-5.9) [source] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]</div>
<div><br>
</div>
<div>1</div>
<div>2</div>
<div><br>
</div>
<div>=INFO REPORT==== 6-Feb-2012::18:15:15 ===</div>
<div>    application: session</div>
<div>    exited: {shutdown,{session_app,start,[normal,[]]}}</div>
<div>    type: permanent</div>
<div>Eshell V5.9  (abort with ^G)</div>
<div>(session@127.0.0.1)1> {"Kernel pid terminated",application_controller,"{application_start_failure,session,{shutdown,{session_app,start,[normal,[]]}}}"}</div>
<div><br>
</div>
<div>Crash dump was written to: erl_crash.dump</div>
<div>Kernel pid terminated (application_controller) ({application_start_failure,session,{shutdown,{session_app,start,[normal,[]]}}})</div>
<div><br>
</div>
<div><br>
</div>
<div>FILE session_app.erl</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>-module(session_app).</div>
<div><br>
</div>
<div>-behaviour(application).</div>
<div><br>
</div>
<div>%% Application callbacks</div>
<div>-export([start/0, start/2, stop/1]).</div>
<div><br>
</div>
<div>%% ===================================================================</div>
<div>%% Application callbacks</div>
<div>%% ===================================================================</div>
<div><br>
</div>
<div>%% start/0 is only to use for testing in the shell</div>
<div>start() -></div>
<div>    {ok, Pid} = session_sup:start_link(),</div>
<div>    unlink(Pid).</div>
<div><br>
</div>
<div>start(_StartType, _StartArgs) -></div>
<div>    session_sup:start_link().</div>
<div><br>
</div>
<div>stop(_State) -></div>
<div>    ok.</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>FILE session_sup.erl</div>
<div><br>
</div>
<div>
<div><br>
</div>
<div>-module(session_sup).</div>
<div><br>
</div>
<div>-behaviour(supervisor).</div>
<div><br>
</div>
<div>%% API</div>
<div>-export([start_link/0]).</div>
<div><br>
</div>
<div>%% Supervisor callbacks</div>
<div>-export([init/1]).</div>
<div><br>
</div>
<div>%% Helper macro for declaring children of supervisor</div>
<div>-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).</div>
<div><br>
</div>
<div>%% ===================================================================</div>
<div>%% API functions</div>
<div>%% ===================================================================</div>
<div><br>
</div>
<div>start_link() -></div>
<div>    supervisor:start_link({local, ?MODULE}, ?MODULE, []).</div>
<div><br>
</div>
<div>%% ===================================================================</div>
<div>%% Supervisor callbacks</div>
<div>%% ===================================================================</div>
<div><br>
</div>
<div>init([]) -></div>
<div>    Controller = ?CHILD(controller, worker),</div>
<div>    {ok, { {one_for_one, 5, 10}, [Controller]} }.</div>
<div><br>
</div>
</div>
<div><br>
</div>
<div>FILE reltool.config</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>{sys, [</div>
<div>       {lib_dirs, ["../../"]},</div>
<div>       {erts, [{mod_cond, derived}, {app_file, strip}]},</div>
<div>       {app_file, strip},</div>
<div>       {rel, "session", "1",</div>
<div>        [</div>
<div>         kernel,</div>
<div>         stdlib,</div>
<div>         sasl,</div>
<div>         session</div>
<div>        ]},</div>
<div>       {rel, "start_clean", "",</div>
<div>        [</div>
<div>         kernel,</div>
<div>         stdlib</div>
<div>        ]},</div>
<div>       {boot_rel, "session"},</div>
<div>       {profile, embedded},</div>
<div>       {incl_cond, exclude},</div>
<div>       {excl_archive_filters, [".*"]}, %% Do not archive built libs</div>
<div>       {excl_sys_filters, ["^bin/.*", "^erts.*/bin/(dialyzer|typer)",</div>
<div>                           "^erts.*/(doc|info|include|lib|man|src)"]},</div>
<div>       {excl_app_filters, ["\.gitignore"]},</div>
<div>       {app, sasl,   [{incl_cond, include}]},</div>
<div>       {app, stdlib, [{incl_cond, include}]},</div>
<div>       {app, kernel, [{incl_cond, include}]},</div>
<div>       {app, session, [{incl_cond, include}]}</div>
<div>      ]}.</div>
<div><br>
</div>
<div>{target_dir, "session"}.</div>
<div><br>
</div>
<div>{overlay, [</div>
<div>           {mkdir, "log/sasl"},</div>
<div>           {copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},</div>
<div>           {copy, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},</div>
<div>           {copy, "files/session", "bin/session"},</div>
<div>           {copy, "files/sys.config", "releases/\{\{rel_vsn\}\}/sys.config"},</div>
<div>           {copy, "files/session.cmd", "bin/session.cmd"},</div>
<div>           {copy, "files/start_erl.cmd", "bin/start_erl.cmd"},</div>
<div>           {copy, "files/vm.args", "releases/\{\{rel_vsn\}\}/vm.args"}</div>
<div>          ]}.</div>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</body>
</html>