Erlang/OTP Forums

Author Message

<  Open Telecom Platform (OTP)  ~  bad_application error starting erlang gen_server application

andyc
Posted: Sat Apr 10, 2010 2:19 pm Reply with quote
Joined: 10 Apr 2010 Posts: 4
I have written a simple erlang app using gen_server.

When starting it with application:start(myapp), I get the following tuple...

{error,{bad_application,{application,myapp ... (rest of my application config).

There are no other error or warning messages. I have also tried to google examples of how to configure gen_server and also the error itself. I am surprised at how little information there is out there.

I could start trying to debug OTP?? Any pointers would be appreciated.
View user's profile Send private message
Michal Ptaszek
Posted: Tue Apr 13, 2010 7:01 am Reply with quote
User Joined: 01 May 2008 Posts: 35 Location: Krakow
The {error, {bad_application, Name}} error is returned when application:start(Name) is called with a wrong argument.

According to the documentation, Name must be an atom. However, from looking at the error you pasted:

{error,{bad_application,{application,myapp ..}}

I conclude the application has been started as:

application:start({application, myapp, ...})

instead of

application:start(myapp).

(I assume you are using interactive, not embedded mode)
View user's profile Send private message
andyc
Posted: Tue Apr 13, 2010 11:54 am Reply with quote
Joined: 10 Apr 2010 Posts: 4
I have passed the atom myapp , the atom representing the name of the application.
View user's profile Send private message
Michal Ptaszek
Posted: Tue Apr 13, 2010 11:58 am Reply with quote
User Joined: 01 May 2008 Posts: 35 Location: Krakow
How does the myapp.app file contents look like then?
View user's profile Send private message
andyc
Posted: Tue Apr 13, 2010 12:42 pm Reply with quote
Joined: 10 Apr 2010 Posts: 4
The idea is to expose some code in foo.py via an erlang 'port'.

Code:

{appliction, foo_app,
 [{description, "Foo Port server"},
  {vsn, "1.0"},
  {modules, [foo_app, foo_sup, foo]},
  {registered, [foo]},
  {applications, [kernal, stdlib]},
  {mod, {foo_app, []}},
  {env, [{extprog, "foo.py"}, {timeout, 3000}, {maxline, 100}]}
]}.
View user's profile Send private message
Michal Ptaszek
Posted: Tue Apr 13, 2010 2:28 pm Reply with quote
User Joined: 01 May 2008 Posts: 35 Location: Krakow
I can see a typo in application keyword in .app file: is it the case?
View user's profile Send private message
andyc
Posted: Wed Apr 14, 2010 12:24 am Reply with quote
Joined: 10 Apr 2010 Posts: 4
Wo, you are right Shocked

Thanks very much for helping me find this insideous little 'bug'. I hope OTP might get better error messages moving forward Confused

I really appreciate your help. (haven't tested this since, i'm at work)
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum