Bad_application error when launching erlang gen_server application
I wrote a simple erlang application using gen_server.
When running with app: start (myapp), I get the following tuple ...
{error, {bad_application, {appliction, myapp ... (the rest of my application config).
There are no other error or warning messages. I've also tried to provide examples of how to set up gen_server as well as the error itself. I am surprised how little information there is.
Can I start trying to debug OTP? Any pointers would be appreciated.
source to share
There is quite a bit of information on how to implement an erlang application in the Appendix section of the OTP Design Principles . It looks like you are trying to use gen_server as a callback for the application you are launching. It just doesn't work.
The most common setup for an application is to have an application callback module that launches a dispatcher that has gen_server as a worker somewhere. Applications don't need to start any processes at all. Applications can exist solely to load some library modules into vm like application stdlib
. This allows other applications to have library dependencies.
source to share
You can also check out the following tutorial on debugging Erlang functions:
http://aloiroberto.wordpress.com/2009/02/23/tracing-erlang-functions/
source to share