| Author |
Message |
< Open Telecom Platform (OTP) ~ bad_application error starting erlang gen_server application |
| andyc |
Posted: Sat Apr 10, 2010 2:19 pm |
|
|
|
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. |
|
|
| Back to top |
|
| Michal Ptaszek |
Posted: Tue Apr 13, 2010 7:01 am |
|
|
|
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) |
|
|
| Back to top |
|
| andyc |
Posted: Tue Apr 13, 2010 11:54 am |
|
|
|
Joined: 10 Apr 2010
Posts: 4
|
| I have passed the atom myapp , the atom representing the name of the application. |
|
|
| Back to top |
|
| Michal Ptaszek |
Posted: Tue Apr 13, 2010 11:58 am |
|
|
|
User
Joined: 01 May 2008
Posts: 35
Location: Krakow
|
| How does the myapp.app file contents look like then? |
|
|
| Back to top |
|
| andyc |
Posted: Tue Apr 13, 2010 12:42 pm |
|
|
|
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}]}
]}.
|
|
|
| Back to top |
|
| Michal Ptaszek |
Posted: Tue Apr 13, 2010 2:28 pm |
|
|
|
User
Joined: 01 May 2008
Posts: 35
Location: Krakow
|
| I can see a typo in application keyword in .app file: is it the case? |
|
|
| Back to top |
|
| andyc |
Posted: Wed Apr 14, 2010 12:24 am |
|
|
|
Joined: 10 Apr 2010
Posts: 4
|
Wo, you are right
Thanks very much for helping me find this insideous little 'bug'. I hope OTP might get better error messages moving forward
I really appreciate your help. (haven't tested this since, i'm at work) |
|
|
| Back to top |
|
|
|