PDA

View Full Version : Build Jabberd2.2.2 with Oracle


toucan
07-31-2008, 07:12 PM
Hi,

I've been sucessfully using Jabberd with MySQL and now want to test using Oracle. I'll installed the Oracle OCI drivers on RHEL 5.

authreg_oracle.c: In function 'ar_init':
authreg_oracle.c:576: error: 'struct authreg_st' has no member named 'get_authreg_user'
make[2]: *** [authreg_oracle_la-authreg_oracle.lo] Error 1
make[2]: Leaving directory `/usr/local/notifier/jabberd-2.2.2/storage'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/notifier/jabberd-2.2.2'
make: *** [all] Error 2


Also, is there a way in sm.xml/c2s.xml to configure the OCI driver for Oracle to use Oracle Service Names ?

Is anyone using Jabberd2 in this way and are the oracle modules being maintained ?

I don't have the full oracle thick/thin drivers installed on my server machine, just the OCI drivers.

[root@redhat jabberd-2.2.2]# rpm -qa | grep -i oracle
oracle-instantclient-devel-10.2.0.4-1
oracle-instantclient-basic-10.2.0.4-1
oracle-instantclient-sqlplus-10.2.0.4-1


Thanks.

Lindroid
10-15-2008, 10:20 AM
Hi! I'd like to know how to make jabberd2 work with Oracle backend
included in the latest version of jabberd2, 2.2.4.
I like this server and made a few installations using MySQL, sqlite,
Berkeley DB as backends.
At my work there's a Linux server with Oracle 11g installed. I
downloaded jabberd-2.2.4, configured:

$ ./configure --prefix=$HOME \
--enable-debug \
--enable-ssl \
--enable-mysql=/usr \
--enable-db \
--enable-oracle \
--with-oracle-home=/opt/oracle/11

(I created special user 'jabber' and all installation done in it's
home folder) configured OK

$ make
got this error:

authreg_oracle.c: In function �ar_init�:
authreg_oracle.c:576: error: �struct authreg_st� has no member named
�get_authreg_user�
make[2]: *** [authreg_oracle_la-authreg_oracle.lo] Error 1
make[2]: Leaving directory `/srv/jabber/jabberd-2.2.4-a/storage'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/srv/jabber/jabberd-2.2.4-a'
make: *** [all] Error 2


to solve line 576 in storage/autherg_oracle.c was commented out:
// ar->get_authreg_user = _ar_oracle_get_authreg_user;

compiled OK, installed

Both c2s and sm configured to use Oracle, but sm doesn't work this way:

$ router &
$ sm -D

Wed Oct 15 09:38:22 2008 [notice] starting up
Wed Oct 15 09:38:22 2008 [notice] id: jabber.polt.ua
Wed Oct 15 09:38:22 2008 [info] process id is 18020, written to
/srv/jabber/var/jabberd/pid/sm.pid
Wed Oct 15 09:38:22 2008 storage.c:94 adding arbitrary types to driver 'oracle'
Wed Oct 15 09:38:22 2008 storage.c:117 driver not loaded, trying to init
Wed Oct 15 09:38:22 2008 [info] loading 'oracle' storage module
Wed Oct 15 09:38:22 2008 storage.c:139 preloaded module 'oracle' (not
initialized yet)
Wed Oct 15 09:38:22 2008 storage.c:158 calling driver initializer
Wed Oct 15 09:38:22 2008 [error] (st_oracle_init: Connect to Server)
Error - ORA-12504: TNS:listener was not given the SERVICE_NAME in
CONNECT_DATA


Wed Oct 15 09:38:22 2008 [notice] initialisation of storage driver
'oracle' failed
Wed Oct 15 09:38:22 2008 [error] failed to initialise one or more
storage drivers, aborting

When c2s uses Oracle and sm uses Berkeley DB, almost everything works fine.
I can register new users using any client software (I saw records in
Oracle tables), but can't connect later (not authoirsed).

I copied part of code from authreg_oracle.c, function ar_init to
function st_init in storage_oracle.c to make it work seamlessly. Error
disappeared. Connects fine. But registered clients still can't connect
after registration.

What's wrong with Oracle backend? I googled a few days but did not
find any solution. Backend needs deep hack? Who has experience?

Lindroid
10-18-2008, 10:46 AM
Solved! Jabberd2 successfully works with Oracle DB.
http://jabberd2.xiaoka.com/changeset/711/
Viva Open Source!