[erlang-questions] Erlyweb Problem

Tony Perrie tony@REDACTED
Fri May 4 01:55:02 CEST 2007


I'm attempting to run the Erlyweb example, but I'm getting the following error:

sudo yaws -i --conf yaws.conf
Erlang (BEAM) emulator version 5.5.4 [source] [async-threads:0]
[kernel-poll:false]

Eshell V5.5.4  (abort with ^G)
1>
=INFO REPORT==== 3-May-2007::16:43:47 ===
Yaws: Using config file yaws.conf
yaws:Add path "/usr/local/lib/yaws/examples/ebin"
yaws:Running with id=default
Running with debug checks turned on (slower server)
Logging to directory "."

=INFO REPORT==== 3-May-2007::16:43:47 ===
Yaws: Listening to 127.0.0.1:8000 for servers
 - http://127.0.0.1:8000 under /Users/jperrie/erlapps/music/www

1>
1> erlyweb:compile("/Users/jperrie/erlapps/music", [{erlydb_driver, mysql}]).
debug:erlyweb_compile:340: Compiling Erlang file "music_app_controller"
debug:erlyweb_compile:340: Compiling Erlang file "musician_view"
debug:erlyweb_compile:340: Compiling Erlang file "musician_controller"
debug:erlyweb_compile:340: Compiling Erlang file "musician"
debug:erlyweb_compile:335: Compiling ErlTL file "html_container_view"
debug:erlyweb_compile:340: Compiling Erlang file "html_container_controller"
debug:erlyweb_compile:104: Generating ErlyDB code for models: "musician.erl "
** exited: {noproc,{gen_server,call,
                              [mysql_dispatcher,
                               {fetch,erlydb_mysql,<<"show tables">>}]}} **
2>
2> erlydb:start(mysql, [{hostname, "localhost"}, {username,
"jperrie"}, {password, "password"}, {database, "music"}]).
mysql_conn:612: greeting version "5.0.27-standard" (protocol 10) salt
"cM:wm<!/" caps 41516 serverchar <<8,2,0,0,

                                 0,0,0,0,

                                 0,0,0,0,

                                 0,0,0,0>>salt2 "iE[zu\\LG]!+S"
mysql_auth:187: mysql_auth send packet 1: <<5,162,0,0,64,66,15,0,8,0,0,0,0,0,0,
                                           0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                           106,112,101,114,114,105,101,0,20,
                                           88,147,69,92,86,192,94,46,151,64,

185,17,142,240,222,193,75,187,204,62>>
mysql_conn:418: fetch <<"use music">> (id <0.82.0>)
{ok,<0.80.0>}
3> erlyweb:compile("/Users/jperrie/erlapps/music", [{erlydb_driver,
mysql}]).
debug:erlyweb_compile:340: Compiling Erlang file "music_app_controller"
debug:erlyweb_compile:340: Compiling Erlang file "musician_view"
debug:erlyweb_compile:340: Compiling Erlang file "musician_controller"
debug:erlyweb_compile:340: Compiling Erlang file "musician"
debug:erlyweb_compile:335: Compiling ErlTL file "html_container_view"
debug:erlyweb_compile:340: Compiling Erlang file "html_container_controller"
debug:erlyweb_compile:104: Generating ErlyDB code for models: "musician.erl "
mysql_conn:418: fetch <<"show tables">> (id <0.82.0>)
mysql_conn:418: fetch <<"describe musician">> (id <0.82.0>)
{ok,{{2007,5,3},{16,45,22}}}
4>
=ERROR REPORT==== 3-May-2007::16:45:43 ===


ERROR erlang  code  crashed:
 File: appmod:0
Reason: {no_such_function,{"musician",
                          "index",
                          1,
                          "You tried to invoke a controller function
that doesn't exist or that isn't exported"}}
Req: {http_request,'GET',{abs_path,"/music/musician"},{1,1}}

The following files exist:

/Users/jperrie/erlapps/music/
/Users/jperrie/erlapps/music//ebin
/Users/jperrie/erlapps/music//ebin/html_container_controller.beam
/Users/jperrie/erlapps/music//ebin/html_container_view.beam
/Users/jperrie/erlapps/music//ebin/music_app_controller.beam
/Users/jperrie/erlapps/music//ebin/music_erlyweb_data.beam
/Users/jperrie/erlapps/music//ebin/musician.beam
/Users/jperrie/erlapps/music//ebin/musician_controller.beam
/Users/jperrie/erlapps/music//ebin/musician_view.beam
/Users/jperrie/erlapps/music//src
/Users/jperrie/erlapps/music//src/components
/Users/jperrie/erlapps/music//src/components/ebin
/Users/jperrie/erlapps/music//src/components/html_container_controller.erl
/Users/jperrie/erlapps/music//src/components/html_container_view.et
/Users/jperrie/erlapps/music//src/components/musician.erl
/Users/jperrie/erlapps/music//src/components/musician_controller.erl
/Users/jperrie/erlapps/music//src/components/musician_view.erl
/Users/jperrie/erlapps/music//src/music_app_controller.erl
/Users/jperrie/erlapps/music//www
/Users/jperrie/erlapps/music//www/index.html
/Users/jperrie/erlapps/music//www/style.css

The database is accessible with the password, and the data is there.

I tried adding a "-pa /Users/jperrie/erlapps/music/src/components" to
the command-line as well.

I'm not really sure how to debug this though.   I feel like the
"musician" component isn't getting loaded, but I'm not sure how to
load it.

Any help would be appreciated,

Tony



More information about the erlang-questions mailing list