otp - Erlang application problem -


i try write application erlang program.

i have test_app.erl:

-module(test_app).  -behaviour(application).  %% application callbacks -export([start/2, stop/1]).  start(_type, _startargs) ->     test_sup:start_link().  stop(_state) ->   ok. 

and .app file:

{application, test,   [{description, "test system."},   {vsn, "1.0"},   {modules, [test_app, test_sup, fsm]},   {registered, [test_sup, fsm]},   {applications, [kernel, stdlib]},   {mod, {test_app, []}} ]}. 

when try start application:

application:start(test). 

i error:

=info report==== 18-feb-2011::19:38:53 ===     application: test     exited: {bad_return,                 {{test_app,start,[normal,[]]},                  {'exit',                      {undef,                          [{test_sup,start_link,[[]]},                           {test_app,start,2},                           {application_master,start_it_old,4}]}}}}     type: temporary {error,{bad_return,{{test_app,start,[normal,[]]},                     {'exit',{undef,[{test_sup,start_link,[[]]},                                     {test_app,start,2},                                     {application_master,start_it_old,4}]}}}}} 

what's wrong? how can fix it?

if make in eshell:

test_app:start(normal, []). 

than works.

thank you.

i suppose might caused not loading [proper] .beam. ensure modules in same directory, or try use -pa key erl(1), e. g.:

$ erl -pa ../ebin 1> application:start(test). ... 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -