[erlang-questions] Application can not be started

张国富 cleancode@REDACTED
Wed Oct 22 19:32:45 CEST 2014


Thanks, it is very helpful.
Now I added a module dummy_proj and the start function is implemented, finally it's working by 
$ erl -pa apps/ebin/ -boot start_sasl -s dummy_proj


But personally I do not want to add a entire new module just for this purpose, So I tried something else.
However, another problem shows up, that when I start erl shell by 
$ erl -pa apps/ebin/ -boot start_sasl -s application start dummy_proj
or
$ erl -pa apps/ebin/ -boot start_sasl -s application ensure_all_started dummy_proj
Nothing will go wrong but application dummy_proj will not be started at the same time.
On the other hand, if I try 
$ erl -pa apps/ebin/ -boot start_sasl -s appmon start
the AppMon tool will be started as expected.


That's to say the application:start(dummy_proj) was called, but nothing happened.
It's weird.


Best wishes.
zhangguofu (Gary)


在 2014-10-22 15:13:24,"T Ty" <tty.erlang@REDACTED> 写道:

According to the Erlang documentation 


http://erlang.org/doc/man/erl.html when you call



    erl -s module


And no other arguments provided it defaults to Func "start" and if no arguments are provided, the function is assumed to be of arity 0.


On Tue, Oct 21, 2014 at 11:48 PM, Jay Doane <jay@REDACTED> wrote:

I believe this line


{"init terminating in do_boot",{undef,[{dummy_proj,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}}



indicates that the function start/0 is not defined in module dummy_proj, so if you want to start it like that on the command line, you could try adding something like the following to dummy_proj.erl:
-export([start/1]).
start() ->

    application:ensure_all_started(dummy_proj).




On Tue, Oct 21, 2014 at 1:33 PM, 张国富 <cleancode@REDACTED> wrote:

Hello all,
I'm now following a Erlang rebar tutorial at http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades, the test application can be started inside the erlang shell, like
$ erl -pa apps/ebin/ -boot start_sasl
1> application:start(dummy_proj). 
=PROGRESS REPORT==== 21-Oct-2014::21:16:13 ===
         application: dummy_proj
          started_at: nonode@REDACTED
ok
2> dummy_proj_server:poke().
{ok,1}
but it can not be started this way
$ erl -pa apps/ebin/ -boot start_sasl -s dummy_proj
Erlang R16B03 (erts-5.10.4) [source] [smp:4:4] [async-threads:10] [kernel-poll:false]
.... <skip> .....
=PROGRESS REPORT==== 21-Oct-2014::21:17:23 ===
         application: sasl
          started_at: nonode@REDACTED
{"init terminating in do_boot",{undef,[{dummy_proj,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()


It seems Erlang is trying to call dummy_proj:start(), but I can not understand why.
Anybody who ever encountered the same problem here? How can I make it work?


Thanks.


Best wishes


zhangguofu(Gary)








_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://erlang.org/mailman/listinfo/erlang-questions





_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://erlang.org/mailman/listinfo/erlang-questions



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141023/20f17f70/attachment.htm>


More information about the erlang-questions mailing list