[JDEV] XDB Component in Java

David Barth dbarth at idealx.com
Mon Jan 8 03:03:09 CST 2001


This setup works more or less for me :

First xdb.xml, turns a SQL base into a Jabber/XML base :

<jabber>
  <service id="xdbgw">
    <host/>
    <accept>
      <port>5270</port>
      <secret>secret</secret>
      <ip/>
      </accept>
  </service>
 
  <log id='xdblog'>
    <host>xdblog.localhost</host>
    <format>%d: [%t] (%h): %s</format>
    <file>/tmp/xdb-error.log</file>
    <stderr/>
  </log>
 
  <xdb id="xdb_handler">
    <host>mydomain.org</host>
   
<load><xdb_sql>/usr/local/lib/jabber/xdb_sql.so</xdb_sql></load>                                          
    <!-- xdb_sql config follows -->
  </xdb>
</jabber>

Then, you connect you session manager (jsm.xml) with this XDB gateway :

<jabber>
  <service id="sessions">
    <host><jabberd:cmdline flag="h">localhost</jabberd:cmdline></host>
    <host>mydomain.org</host>
    <jsm xmlns="jabber:config:jsm">
      <log>
        <file>/var/log/jabber-session.log</file>
        <type>session</type>
      </log>
    </jsm>
     <load main="jsm">
      <!-- trimmed down session manager -->
      <jsm>/usr/local/lib/jabber/jsm.so</jsm>
      <mod_roster>/usr/local/lib/jabber/jsm.so</mod_roster>
      <mod_filter>/usr/local/lib/jabber/jsm.so</mod_filter>
      <mod_presence>/usr/local/lib/jabber/jsm.so</mod_presence>
      <mod_auth_plain>/usr/local/lib/jabber/jsm.so</mod_auth_plain>
      <mod_log>/usr/local/lib/jabber/jsm.so</mod_log>
    </load>
   </service>

  <!-- all XDB packets should go through the pipe --> 
  <xdb id="xdbgw">
    <host/>
      <connect>
        <port>5270</port>
        <secret>secret</secret>
        <ip>127.0.0.1</ip>
      </connect>
  </xdb>

  <!-- add c2s client socket manager -->

</jabber>


Then, you should be able to, at least, authenticate.
$ telnet localhost 5222
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
<stream:stream to='domaing.org' xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'>
<?xml version='1.0'?><stream:stream
xmlns:stream='http://etherx.jabber.org/streams' id='3A5982B8'
xmlns='jabber:client' from='domain.org'>
<iq id='6' type='set'><query
xmlns='jabber:iq:auth'><username>test</username><resource>test</resource><password>test</password></query></iq>
<iq id='6' type='result'/>
<presence/>
<iq type='get' id='5'><query xmlns='jabber:iq:roster'></query></iq>
Connection closed by foreign host. 

At this point jabberd cores in random places... Sometimes just in
offline message delivery, sometimes in mod_roster_out_iq without a
reason (pointers seem to be ok).

Tell me if it works for you, and perhaps we'll be able to find the bug
triggerd after that ;-)

--
dbarth




More information about the JDev mailing list