I am unable to use `ejabberd_auth` in my **helloworld** project

后端 未结 1 1597
误落风尘
误落风尘 2020-12-20 22:30

I am unable to use ejabberd_auth in my helloworld project.

-behaviour(ejabberd_auth). 
... 
....  
try_register(<<\"us         


        
相关标签:
1条回答
  • 2020-12-20 23:12

    I can get you past that error. Here's how...

    When I compile a module in the erlang shell, the compiler creates a .beam file in the same directory, which allows me to call functions defined in the module. In your case, if you cd into the directory:

     .../ejabberd/ebin 
    

    you will see all the ejabberd .beam files, including ejabberd_auth.beam. If you start an erlang shell in that directory, then issue your function call (don't compile anything), you won't get that error anymore.

    But, then I get the error:

    exception error: undefined function jid:nodeprep/1
         in function  ejabberd_auth:validate_credentials/3 (src/ejabberd_auth.erl, line 796)
         in call from ejabberd_auth:try_register/3 (src/ejabberd_auth.erl, line`
    

    There is no jid.beam file in that directory. But:

    ~/Downloads/ejabberd$ find . -name jid.beam
    ./deps/xmpp/ebin/jid.beam
    

    You are going to have to figure out how to compile your module so that all the ejabberd modules are available to your program. See: ejabberd how to compile new module.

    I am unable to use ejabberd_auth in my helloworld project.

    Are you following a tutorial somewhere?

    0 讨论(0)
提交回复
热议问题