<br><br><div class="gmail_quote">2011/11/2 Alexander Kuleshov <span dir="ltr"><<a href="mailto:kuleshovmail@gmail.com">kuleshovmail@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>Hello,<br></div><div><br></div><div>I try to run jabber bot in ejabberd, written with exmpp.</div><div><br></div><div>My bot is usual gen_server remade from example: <a href="https://github.com/onlyshk/exmpp/blob/master/examples/echo_client.erl" target="_blank">https://github.com/onlyshk/exmpp/blob/master/examples/echo_client.erl</a></div>

<div><br></div><div>If i run it from terminal it's ok i see online bot in admin page. But if i try to run it with my ejabberd module, inside in it, i get crash report:</div><div><br></div><div>=ERROR REPORT==== 2-Nov-2011::16:30:25 ===<br>

** State machine <0.416.0> terminating <br>** Last event in was tcp_closed (for all states)<br>** When State == stream_opened<br>**      Data  == {state,digest,<br>{{jid,<<"mybot@localhost/exmpp#1320251360207273">>,</div>

<div><<"mybot">>,<<"localhost">>,<br>                          <<"exmpp#1320251360207273">>},<br>                      "password"},<br>                     {0,0},<br>

                     false,false,false,<br>                     [{compression,enabled},{starttls,enabled}],<br>                     "localhost","localhost",<0.415.0>,exmpp_socket,<br>                     {gen_tcp,#Port<0.5947>},<br>

                     {xml_stream,<br>                         {gen_fsm,<0.416.0>},<br>                         {xml_parser,<br>                             [{max_size,infinity},<br>                              {root_depth,1},<br>

                              {names_as_atom,true},<br>                              {emit_endtag,true},<br>                              {check_nss,xmpp},<br>                              {check_elems,xmpp},<br>                              {check_attrs,xmpp}],<br>

                             #Port<0.5840>},<br>                         new,false,undefined},<br>                     "3244568556",undefined,<0.428.0>,undefined,undefined}<br>** Reason for termination = <br>

** tcp_closed<br><br>=CRASH REPORT==== 2-Nov-2011::16:30:25 ===<br>  crasher:<br>    initial call: exmpp_session:init/1<br>    pid: <0.416.0><br>    registered_name: []<br>    exception exit: tcp_closed<br>      in function  gen_fsm:terminate/7<br>

ancestors: [mybot,ejabberd_sup,<0.40.0>]<br>    messages: []<br>    links: []<br>    dictionary: [{random_seed,{1320,8904,23723}}]<br>    trap_exit: false<br>    status: running<br>    heap_size: 1597<br>    stack_size: 24<br>

    reductions: 1162<br>  neighbours:<br> </div><div>How can i run it with ejabberd module?</div><div><br></div><div>Thank you.</div>
</blockquote></div><div><br></div><div>And also i got:<br></div><div><br></div><div>=CRASH REPORT==== 2-Nov-2011::16:29:25 ===<br>  crasher:<br>    initial call: xmpp_talker:init/1<br>    pid: <0.415.0><br>    registered_name: []<br>
    exception exit: {timeout,{gen_fsm,sync_send_event,<br>                                      [<0.416.0>,<br>                                       {connect_socket,"localhost",5222,[]},<br>                                       5000]}}<br>
      in function  gen_server:init_it/6<br>    ancestors: [ejabberd_sup,<0.40.0>]<br>    messages: []<br>    links: [<0.245.0>]<br>    dictionary: []<br>    trap_exit: false<br>    status: running<br>    heap_size: 610<br>
    stack_size: 24<br>    reductions: 320<br>  neighbours:<br></div>