tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matchim, Brian - BOP/BDP" <>
Subject RE:HPUX11 + mod_jk
Date Tue, 12 Dec 2000 03:02:01 GMT
Hi Everyone,

I have received several e-mails from concerned users of Tomcat and HPUX11
since I first posted the
article "HPUX11 + mod_jk" on this listserv.  I am happy to say that I did
solve my own problem with 
the help of a co-worker, however, due to work activities I was unable to
deliver this reply until now.

Essentially there are three files that need to be modified to get mod_jk to
compile properly on HPUX11.
The directory where these files are located will change depending on the
version of Tomcat you are using,
it will either be $TOMCAT_HOME/src/native/jk  OR
$TOMCAT_HOME/src/native/mod_jk/common.  I haven't
used the newly released version, TOMCAT 3.2, so the directory may have
changed yet again.

The files that need to modified are:
- jk_pool.h
- jk_global.h
- jk_jni_worker.c**

**Through correspondence with other developers it appears that the fix to
jk_jni_worker.c is not a 
necessary fix.  However, this hasn't been fully tested, but I can say that
by completing the code
change, it eliminates the "warnings" produced by jk_jni_worker during

There is also one other extremely important note for the compilation of
mod_jk.  If you are using 
a compiler such as gcc that runs in 64-bit mode on HPUX11 you should have
less problems with the
install of mod_jk.  If you use the standard 'make Makefile' command then you
will probably compile
correctly but will have no success in using mod_jk.  I far as I can tell,
the reason is that 
HPUX11 is a 64-bit OS, but it uses 32-bit compilers as default.  Tomcat's
distribution code attempts
to use the following dl operations: dlopen(), dlload(), dlerror(), and
dlsym().  Though the code
will compile using a 32-bit compiler, it will not operate correctly and
Apache will refuse to start.
There are two ways around this of course, use a 64-bit compiler (such as
gcc), or you can modify
the code to use the 32-bit equivalents, that is, shl_load(), shl_open(),

All code below is use at your own risk  ;)  I'd also like to thank Charles
Fulton for allowing me to 
use some of the code snippets and instructions that he sent to me directly.
This saves me the trouble
of re-typing them, and also shows that two people came to the same

Code Modifications

1.) Edit the file <path to tomcat src>/src/native/jk/jk_global.h

/* <sys/select> */
commented out the above section, due to the fact that HP's select is now in
<sys/time>. This line was in the if statement checking for netware. 

- otherwise upon running apxs would die with compile errors.

Another alternative is to add an extra #ifndef, that way the same script
will continue to work on other 
platforms.  A different piece code that gets the same result is to change
jk_global.h to look like...

    #ifndef NETWARE
        #include <netinet/tcp.h>
        #include <arpa/inet.h>
        #include <sys/un.h>
        #include <sys/socketvar.h>
        ---- do not include sys/select.h if using HPUX11 ----
        #ifndef HPUX11
          #include <sys/select.h>

2.) Edited file <path to tomcat src>/src/native/jk/jk_pool.h

- Added code to following section, 

HPUX11,HPUX, or HPUX10 are not checked for, AND there is no else for a
default value, so we added an elif for HP to defiine the type of
jk_pool_atom and also a default value. (btw, shouldn't they all just be set
to long and just check for MS to set it on it's own?)

#elif(HPUX11) a
	#elif defined(HPUX11)
    typedef long long   jk_pool_atom_t;
    typedef long long   jk_pool_atom_t;

3.) The third revision is more extensive and involved.  Because I think most
people will 
choose to use gcc, I'm not sure the value of providing this code rewrite.
It is fairly long,
and involves the jk_jni_worker.c file.  Our code test for a 64-bit vs 32-bit
environment and
adjust commands accordingly.

The code re-write is too extensive for the present email. If any one is not
using gcc and cannot
get mod_jk to compile with the instructions provided thus far, let me know
and we will then test
to see if this list serv supports attachments ;)

To give you a small taste of the kind of checking we did, here is one


#if defined(HPUX11) 
  #if defined(__LP64__)
    handle = dlopen(p->jvm_dll_path, RTLD_NOW | RTLD_GLOBAL);
    handle = (void*) shl_load(p->jvm_dll_path,
    handle = dlopen(p->jvm_dll_path, RTLD_NOW | RTLD_GLOBAL);

I hope this helps some of you out there!

View raw message