I'm a newbie to Tomcat and I'm having trouble getting mod_jk.so to link 
right.  I've tried everything I know, scanned the FAQ, and made a stab at 
searching the mailing list archives, all with no success.

Environment: FreeBSD 4.1-RELEASE, JDK 1.1.8 and gmake installed via 
/usr/ports, Apache 1.3.19 + mod_ssl 2.8.1 installed from source.

I'm trying to build mod_jk from Tomcat 3.2.1.  On the first try, I 
installed mod_jk.so, updated httpd.conf appropriately, and restarted Apache 
only to get:

    Cannot load /usr/local/apache/libexec/mod_jk.so into server:
    /usr/local/apache/libexec/mod_jk.so: Undefined symbol "fdatasync"

After a little digging, I found fdatasync in ../jk/jkutil.c surrounded by 
"#ifndef FREEBSD/#endif", so it shouldn't have compiled.  Then I noticed 
that Makefile.freebsd had CFLAGS=-DLINUX.  Hmph.  So I changed that to 
-DFREEBSD and remade.  Now I get this:

Cannot load /usr/local/apache/libexec/mod_jk.so into server: 
/usr/local/apache/libexec/mod_jk.so: Undefined symbol "pthread_mutex_unlock"

Grrr...  OK, I noticed that the gcc command invoked by apxs to link 
mod_jk.so didn't include -pthread, so I relinked manually and specify 
-pthread.  Same problem.  [Grinds teeth...]  I tried manually relinking 
again, but instead of using -pthreads I appended "-lc_r" to the link 
command to force it to use libc_r.  Now Apache dies as soon as it starts, 
without logging anything to error_log.  I guess it crashes during the 
LoadModule for mod_jk.so (why -pthread and -lc_r should behave differently 
is beyond me).  Hoping to get it to spit something useful to my terminal, I 
ran it as "httpd -X".  Now it works!  I can execute servlets and 
everything.  What the **** is going on here?  Finally, I manually linked 
one more time but specified /usr/lib/libc_r.a to force a static link 
instead of the default dynamic link against libc_r.so.  That made Apache 
die with SIGSEGV.

I looked around through the source code and found that the pthread_mutex 
stuff is used only in jk_ajp13_worker.c, so I compiled and linked without 
AJP13 support and everything works properly.  However, I'd really like to 
have AJP13 support because the documentation says that this provides better 
SSL support.

I usually try to figure this stuff out for myself before appealing to a 
mailing list with what must surely be a FAQ, but I'm at my wits end.  Any 
help would be greatly appreciated.

Many thanks,

                                ++Don

-- 
Donald L. Nash, <[EMAIL PROTECTED]>, PGP Key ID: 0x689DA021
The University of Texas System Office of Telecommunication Services

Reply via email to