问题
I try to configure xmlrpc in my ejabberd server but the server doesnt seem to start after configuring xmlrpc. My ejabberd config is :
{listen,[
{{4560, "127.0.0.1"}, ejabberd_xmlrpc, [
{access_commands, [
%% This bot can only execute the command 'register',
%% and if argument 'host' is provided, it must be "example.org":
{xmlrpcaccess, [register], [{host, "myhost.com"}]}
]}
]},
//many modules added here
]}.
{acl, xmlrpcbot, {user, "USER", "myhost.com"}}.
{access, xmlrpcaccess, [{allow, xmlrpcbot}]}.
and when I start service, I get the below log:
=INFO REPORT==== 2014-04-08 17:26:45 ===
application: ejabberd
exited: {bad_return,
{{ejabberd_app,start,[normal,[]]},
{'EXIT',
{noproc,
{gen_server,call,
[ejabberd_sup,
{start_child,
{ejabberd_odbc_sup_localhost,
{ejabberd_odbc_sup,start_link,["localhost"]},
transient,infinity,supervisor,
[ejabberd_odbc_sup]}},
infinity]}}}}}
type: temporary
Of course the service runs if I comment all xml_rpc config lines. What's causing the error? Thanks
回答1:
I was also facing the same problem when I tried to Configure Ejabberd_xmlrpc in configration file and was getting the same error as you have mentioned in your question,
When I look to the erlang error message "noproc" means "trying to link to non exited process",above error says that there is some issue with your odbc configuration{this message seem eligible if you have configured to use mysql and not configured properly} but while using native db same error occurred than what is the real issue !!!!!!
I spent almost 2 days to solve this error by googling and doing try and error and found a post give on this link by Badlop, thanks to him I finally solve this error.
I will go step by step process so that any new bee to ejabberd wants to configure ejabberd_xmlrpc will not get confused.
before going further I should mention my machine configuration I am using ubuntu 14.04 on my Dell 64-bit machine on which ejabberd 2.1.11 is installed with erlang version R16B03.
On this link official documentation of how to configure and use ejabberd_xmlrpc is given
details given on the above link are as below
1.You need to get and install XMLRPC-Erlang.
You can download XMLRPC-Erlang binary files from http://www.ejabberd.im/ejabberd_xmlrpc or compile it yourself: wget http://www.ejabberd.im/files/contributions/xmlrpc-1.13-ipr2.tgz tar -xzvf xmlrpc-1.13-ipr2.tgz cd xmlrpc-1.13/src make cd ../../ Then you can copy the *.beam files to ejabberd ebin directory, or add an option like this to the ejabberd start script: $ erl -pa '/home/jabber/xmlrpc-1.13/ebin' ...
2.Configure ejabberd to start this listener at startup:
edit ejabberd.cfg and add on the 'listen' section: {listen, [ {4560, ejabberd_xmlrpc, []}, ... ]}. 3.Start ejabberd. 4. Verify that ejabberd is listening in that port.
Every thing was working fine till step 3.
but after executing step 3
$/etc/init.d/ejabberd start
Error occurs which says that server fails to start and look to ejabberd.log file for further information, The log file displays error @user3511518 has mentioned in his post.
How to solve this error!!!!
While reading Badlop answer I realized that I missed to include one file in jabberd/ebin and I have to compile ejabberd_xmlrpc.erl file.
Badlop's answer
You're confused there.
You have installed the xmlrpc library.
Now you also need to compile ejabberd_xmlrpc.erl Download it from http://www.ejabberd.im/ejabberd-modules
before going to http://www.ejabberd.im/ejabberd-modules link make sure you have install svn on your machine now follow the below step[same steps are given on above link].
svn co https://svn.process-one.net/ejabberd-modules
cd ejabberd-modules/ejabberd_xmlrpc/trunk
./build.sh
this will build ejabberd_xmlrpc.beam (compiled version of ejabberd_xmlrpc.erl)
$ cd /(your current diectory)/ejabberd-modules/ejabberd/xmlrpc/trunk/ebin
$ sudo mv ejabberd_xmlrpc.beam /home/jabberd/ebin[this is an example you have to move >this file to ebin folder of directory in which ejabberd is installed on your drive]
at the end restart your machine.
after rebooting check status of ejabberd by typing
$sudo ejabberdctl status
if it shows running than execute below command in your terminal
netstat -ntlp | grep LISTEN
If list shows
tcp 0 0 0.0.0.0:4560 0.0.0.0:* LISTEN
means your xmlrpc is running and listening to http://hostname:4560
please feel free to ask questions!!!!!
Hope this will solve your problem.
来源:https://stackoverflow.com/questions/22940797/error-while-starting-ejabberd-with-xml-rpc