[erlang-questions] Questions about OTP debugging...

Peter W. Morreale pmorreale@REDACTED
Tue Feb 1 15:58:25 CET 2011

On Tue, 2011-02-01 at 07:44 +0100, Bengt Kleberg wrote:
> Greetings,
> Your error message seems to indicate that the tcp_rpc module is not
> loaded. Since Erlang loads beam files automatically if they are in the
> path this could be two problems.
> 1 You do not have the right path
> 2 You do not have the beam file
> Can you locate the file tcp_rpc.beam on your system?

Thanks for the response.

There is no tcp_rpc.beam in this example from the book.  I needed to
create a tcp_rpc.app file in the ebin dir, which defines the modules for
the application.  

(This is chapter 4 of the "Erlang and OTP in Action" book.)

> When you have started Erlang, can you find the directory where the bream
> file resides in your path (see code:get_path/0)?
> bengt

I *think* I have everything in the right place.  Here is what I have for
a directory layout and compile/run (including a code:get_path()):

pmorreale@REDACTED:~/erlang/tcp_rpc> ls -R
doc  ebin  include  priv  src


tcp_rpc.app  tr_app.beam  tr_server.beam  tr_sup.beam



tr_app.erl  tr_server.erl  tr_sup.erl
pmorreale@REDACTED:~/erlang/tcp_rpc> more ebin/tcp_rpc.app 
%% -*- mode: Erlang; fill-column: 75; comment-column: 50; -*-

{application, tcp_rcp, [
	{description, "RPC server for Erlang testing"}, 
	{vsn, "0.1.0"},
	{modules, [tr_app, tr_sup, tr_server]},
	{registered, [tr_sup]},
	{applications, [kernel, stdlib]},
	{mod, {tr_app, []}}
pmorreale@REDACTED:~/erlang/tcp_rpc> erlc -o ebin src/*.erl
pmorreale@REDACTED:~/erlang/tcp_rpc> erl -pa ebin
Erlang R14B (erts-5.8.1) [source] [64-bit] [smp:2:2] [rq:2]
[async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.8.1  (abort with ^G)
1> application:start(tcp_rpc).
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
       (v)ersion (k)ill (D)b-tables (d)istribution
pmorreale@REDACTED:~/erlang/tcp_rpc> erl -pa ebin
Erlang R14B (erts-5.8.1) [source] [64-bit] [smp:2:2] [rq:2]
[async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.8.1  (abort with ^G)
1> code:get_path().
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
       (v)ersion (k)ill (D)b-tables (d)istribution


More information about the erlang-questions mailing list