[xmppd-dev] Problems parsing jabber.xml in Jabberd14 1.6.1.1
Matthias Wimmer
m at tthias.eu
Sun Apr 13 23:43:19 UTC 2008
Hi Jonathan!
Jonathan Abbey schrieb:
> In the xdb_sql.cc code, there is a snippet that looks like this:
>
> xc = xdb_cache(i);
> if (xc != NULL) {
> config = xdb_get(xc, jid_new(xmlnode_pool(x), "config at -internal"), "jabber:config:xdb_sql");
> }
>
> And here is the relevant portion of our jabber.xml file:
>
> <xdb id="xdbsql.jabber-host.arlut.utexas.edu">
> <host/>
> <load>
> <xdb_sql>/home/broccol/jabber/server2/lib/libjabberdxdbsql.so</xdb_sql>
> </load>
> <xdb_sql xmlns="jabber:config:xdb_sql">
> <!-- change the following to <driver>postgresql</driver> -->
> <!-- if you are using PostreSQL. -->
> <driver>mysql</driver>
> <mysql>
> <!-- set your MySQL server credentials here. -->
> <user>jabber</user>
> <password>---</password>
> <host>db1.arlut.utexas.edu</host>
> <database>jabber</database>
> </mysql>
> ..
> </xdb_sql>
> </xdb>
>
> One would expect the config node to point to the either the <xdb_sql>
> element, or perhaps the <xdb> element, but instead it points to the
> empty <host> element. If I forcibly advance the config xmlnode to
> point to its next sibling's next sibling, the rest of the code works
> correctly, and the driver is found and the MySQL credentials are
> loaded correctly.
Most problems with the configuration file are due to problems with
namespace definitions in the XML file. It seems that some people are
doing namespaces wrong.
As you did not post the complete file, I do not know what the namespace
of your <xdb/> element is. I guess that you are defining this element to
be in the jabber:config:xdb_sql namespace (correct would be to have it
in the http://jabberd.org/ns/configfile namespace).
The call
xdb_get(xc, jid_new(xmlnode_pool(x), "config at -internal"),
"jabber:config:xdb_sql")
will load the first child element in the "jabber:config:xdb_sql"
namespace of the service element (which is <xdb/> in your case). If you
get returned the empty host element, this seems to be caused by having
the <xdb/> element and therefore the <host/> child element which does
not redefine namespaces to be in the jabber:config:xdb_sql namespace,
which is wrong.
> The same kind of error appears to be taking place in client.cc:
Again I could imagine that this is caused by incorrect namespace
definitions in the configuration file.
> You can look at our jabber.xml file in its entirety at
>
> http://www.ganymeta.org/jabber_xml.txt
This does not really look like you have the namespaces wrong. Is this
file exactly what you are using, or have you split the configuration to
different files and using the include mechanism of the server?
Matthias
More information about the dev
mailing list