benoitc/couchbeam — Issue #60: using couchbeam in ejabberd module
Author: interactiveobject
Created: 2011-10-19 15:42:45+00:00
State: open

Hi,
I trying to use couchbeam within a ejabberd module, I use this a sample code :

```
-module(mod_test).

-define(EJABBERD_DEBUG, true).
-behaviour(gen_mod).

-include("ejabberd.hrl").
-include("couchbeam.hrl").

-export([start/2, stop/1]).

start(Host, _Opts) ->
?INFO_MSG("mod_test started ~p",[Host]),

application:start(sasl),
application:start(ibrowse),
application:start(couchbeam),
CouchDB = couchbeam:server_connection("localhost",5984 ,"",[]),
{ok, _Version} = couchbeam:server_info(CouchDB),
ok.

stop(Host) ->
?INFO_MSG("mod_test stopping: ~p",[Host]),
ok.
```

But, I still getting this error :
```
=ERROR REPORT==== 2011-10-19 13:21:29 ===
C(<0.34.0>:gen_mod:75) : Problem starting the module mod_test for host "localhost"
options: []
error: undef
```

Am I missing something ?
Thank you in advance
/Y