我成功地将rabbitmq-erlang-client的rebar-friendly包用于一个简单的Hello World rebarized和OTP“兼容”应用程序,并且在开发环境中一切正常。我能够启动一个 erl 控制台并执行我的操作application:start(helloworld).
并连接到代理,打开一个通道并与队列通信。
但是,然后我继续做rebar generate
,它构建了版本就好了,但是当我尝试从自包含的版本包中启动时,事情突然爆炸了。
我知道钢筋发布是一种晦涩难懂的艺术,但我想知道就使用 rabbitmq-erlang-client 部署应用程序而言,我有哪些选择。
您将在下面找到崩溃时控制台的输出:
=INFO REPORT==== 18-Dec-2012::16:41:35 ===
application: session_record
exited: {{{badmatch,
{error,
{'EXIT',
{undef,
[{amqp_connection_sup,start_link,
[{amqp_params_network,<<"guest">>,<<"guest">>,<<"/">>,
"127.0.0.1",5672,0,0,0,infinity,none,
[#Fun<amqp_auth_mechanisms.plain.3>,
#Fun<amqp_auth_mechanisms.amqplain.3>],
[],[]}],
[]},
{supervisor2,do_start_child_i,3,
[{file,"src/supervisor2.erl"},{line,391}]},
{supervisor2,handle_call,3,
[{file,"src/supervisor2.erl"},{line,413}]},
{gen_server,handle_msg,5,
[{file,"gen_server.erl"},{line,588}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,227}]}]}}}},
[{amqp_connection,start,1,
[{file,"src/amqp_connection.erl"},{line,164}]},
{hello_qp,start_link,0,[{file,"src/hello_qp.erl"},{line,10}]},
{session_record_sup,init,1,
[{file,"src/session_record_sup.erl"},{line,55}]},
{supervisor_bridge,init,1,
[{file,"supervisor_bridge.erl"},{line,79}]},
{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,227}]}]},
{session_record_app,start,[normal,[]]}}
type: permanent {"Kernel pid terminated",application_controller
编辑:根据评论中的要求。
reltool.config
{sys, [
{lib_dirs, ["..", "../deps"]},
{erts, [{mod_cond, derived}, {app_file, strip}]},
{app_file, strip},
{rel, "session_record", "0.1.0",
[
kernel,
stdlib,
sasl,
session_record
]},
{rel, "start_clean", "",
[
kernel,
stdlib
]},
{boot_rel, "session_record"},
{profile, embedded},
{incl_cond, derived},
{mod_cond, derived},
{excl_archive_filters, [".*"]}, %% Do not archive built libs
{excl_sys_filters, ["^bin/.*", "^erts.*/bin/(dialyzer|typer)",
"^erts.*/(doc|info|include|lib|man|src)"]},
{excl_app_filters, ["\.gitignore"]},
{app, session_record, [{mod_cond, app}, {incl_cond, include}, {lib_dir, ".."}]},
{app, hipe, [{incl_cond, exclude}]}
]}.
{target_dir, "session_record"}.
{overlay, [
{mkdir, "log/sasl"},
{copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
{copy, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},
{copy, "files/session_record", "bin/session_record"},
{copy, "files/session_record.cmd", "bin/session_record.cmd"},
{copy, "files/start_erl.cmd", "bin/start_erl.cmd"},
{copy, "files/install_upgrade.escript", "bin/install_upgrade.escript"},
{copy, "files/sys.config", "releases/\{\{rel_vsn\}\}/sys.config"},
{copy, "files/vm.args", "releases/\{\{rel_vsn\}\}/vm.args"}
]}.