You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Anthony Marlowe <am...@mac.com> on 2002/12/18 13:11:37 UTC

Apache2, mod_jk2, Tomcat-4.1.12 and jni integration

Hi,

On a Unix Installation  with Mac OS X 10.2.2, java 1.3.1, Apache-2.0.43  
and Tomcat-4.1.2 installed I'm have having problems getting jni to  
properly initilize. I have the same problems on Solaris 5.7 system with  
the identical setup using java 1.4.1_01. During the Apache2 startup  
tomcat and apache startup correctly, however the jni worker is not  
initiated correctly see the Apache2 error_log below.

I needed to change the OPT=-Djava.class.path separator from a ";" to a  
":". The mod_jk2.so and the jkjni.so were built from the  
jakarta-tomcat-connectors-jk2-2.0.2-src with dso and jni enabled. Jni  
was also enabled for the build of httpd-2.0.43.

Any ideas would be appreciated. Thank you in advance.

The Apache stderr.log:

TomcatStarter: main()
Try  org.apache.tomcat.startup.Main
Try  org.apache.catalina.startup.BootstrapService
Starting org.apache.catalina.startup.BootstrapService
Created catalinaLoader in:  
/Volumes/Java_Development/jakarta-tomcat-4.1.12/server/lib
[INFO] Registry - -Loading registry information
[INFO] Registry - -Creating new Registry instance
[INFO] Registry - -Creating MBeanServer
[INFO] AprImpl - -JK2: Initialized apr
[INFO] ChannelJni - -JK2: listening on channel.jni:jni
[INFO] JkMain - -Jk running ID=0 time=6/28   
config=/Volumes/Java_Development/jakarta-tomcat-4.1.12/conf/ 
jk2.properties
TomcatStarter: main()
Try  org.apache.tomcat.startup.Main
Try  org.apache.catalina.startup.BootstrapService
Starting org.apache.catalina.startup.BootstrapService

An portion of the stdout.log:

  Resolving to alternate DTD  
'jar:file:/Volumes/Java_Development/jakarta-tomcat-4.1.12/webapps/ 
struts-upload/WEB-INF/lib/struts.jar!/org/apache/struts/resources/web- 
app_2_2.dtd'
Call  
org.apache.struts.action.ActionServlet.addServletMapping(action/ 
java.lang.String,*.do/java.lang.String)
Bootstrap: Service started
TomcatStarter: Done


The Apache2 error log follows the jk2.properties listing.

The jk2.properties file:

jk2.properties:

handler.list=apr,request,container,channelJni
#
# Override the default port for the socketChannel
# channelSocket.port=8009
# Default:
# channelUnix.file=${jkHome}/work/jk2.socket
# Just to check if the the config  is working
shm.file=/Volumes/Java_Development/jakarta-tomcat-4.1.12/work/jk2.shm

# In order to enable jni use any channelJni directive
channelJni.disabled = 0
# And one of the following directives:

# apr.NativeSo=/Library/Apache2/modules/jkjni.so
# apr.jniModeSo=/Library/Apache2/modules/mod_jk2.so

# If set to inprocess the mod_jk2 will Register natives itself
# This will enable the starting of the Tomcat from mod_jk2
apr.jniModeSo=inproces


Here is the output from the Apache2 error_log, it is a bit long, but I  
think necessary to understand what is occurring during the startup  
process.

[Wed Dec 18 12:13:18 2002] [notice] uriEnv.setAttribute() the worker  
directive is deprecated. Use 'group' instead.
[Wed Dec 18 12:13:18 2002] [notice] Digest: generating secret for  
digest authentication ...
[Wed Dec 18 12:13:18 2002] [notice] Digest: done
[Wed Dec 18 12:13:18 2002] [notice] Apache/2.0.43 (Unix)  
mod_perl/1.99_07-dev Perl/v5.8.0 mod_jk2/2.0.2 DAV/2 PHP/4.2.3  
configured -- resuming normal operations
[Wed Dec 18 12:13:18 2002] [notice] jk2_init() Found child 5525 in  
scoreboard slot 2
[Wed Dec 18 12:13:18 2002] [notice] jk2_init() Found child 5526 in  
scoreboard slot 3
[Wed Dec 18 12:13:18 2002] [notice] jk2_init() Found child 5523 in  
scoreboard slot 0
[Wed Dec 18 12:13:18 2002] [notice] vm.init(): Jni lib:  
/System/Library/Frameworks/JavaVM.framework/Versions/Current/JavaVM
[Wed Dec 18 12:13:18 2002] [notice] jk2_init() Found child 5527 in  
scoreboard slot 4
[Wed Dec 18 12:13:18 2002] [notice] vm.init(): Jni lib:  
/System/Library/Frameworks/JavaVM.framework/Versions/Current/JavaVM
[Wed Dec 18 12:13:18 2002] [notice] jk2_init() Found child 5524 in  
scoreboard slot 1
[Wed Dec 18 12:13:18 2002] [notice] vm.init(): Jni lib:  
/System/Library/Frameworks/JavaVM.framework/Versions/Current/JavaVM
[Wed Dec 18 12:13:18 2002] [notice] vm.init(): Jni lib:  
/System/Library/Frameworks/JavaVM.framework/Versions/Current/JavaVM
[Wed Dec 18 12:13:18 2002] [notice] vm.init(): Jni lib:  
/System/Library/Frameworks/JavaVM.framework/Versions/Current/JavaVM
[Wed Dec 18 12:13:19 2002] [notice] vm.open2() done
[Wed Dec 18 12:13:19 2002] [error] workerEnv.initChannel() init failed  
for channel.jni:jni
[Wed Dec 18 12:13:19 2002] [notice] workerJni.Init() Skipping  
initialization for the 2 5525
[Wed Dec 18 12:13:19 2002] [error] workerEnv.initWorkers() init failed  
for worker.jni:onStartup
[Wed Dec 18 12:13:19 2002] [notice] workerJni.Init() Skipping  
initialization for the 2 5525
[Wed Dec 18 12:13:19 2002] [error] workerEnv.initWorkers() init failed  
for worker.jni:onShutdown
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for  
/jkstatus/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples/servlet/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples/*.jsp
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for  
/admin/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for /
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for /
[Wed Dec 18 12:13:19 2002] [notice] workerEnv.init() ok  
/Library/Apache2/conf/workers2.properties
[Wed Dec 18 12:13:19 2002] [notice] vm.open2() done
[Wed Dec 18 12:13:19 2002] [notice] jni.validate() class=  
org/apache/jk/apr/TomcatStarter
[Wed Dec 18 12:13:19 2002] [notice] vm.open2() done
[Wed Dec 18 12:13:19 2002] [error] workerEnv.initChannel() init failed  
for channel.jni:jni
[Wed Dec 18 12:13:19 2002] [notice] workerJni.Init() Skipping  
initialization for the 3 5526
[Wed Dec 18 12:13:19 2002] [error] workerEnv.initWorkers() init failed  
for worker.jni:onStartup
[Wed Dec 18 12:13:19 2002] [notice] workerJni.Init() Skipping  
initialization for the 3 5526
[Wed Dec 18 12:13:19 2002] [error] workerEnv.initWorkers() init failed  
for worker.jni:onShutdown
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for  
/jkstatus/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples/servlet/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples/*.jsp
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for  
/admin/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for /
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for /
[Wed Dec 18 12:13:19 2002] [notice] workerEnv.init() ok  
/Library/Apache2/conf/workers2.properties
[Wed Dec 18 12:13:19 2002] [notice] vm.open2() done
[Wed Dec 18 12:13:19 2002] [error] workerEnv.initChannel() init failed  
for channel.jni:jni
[Wed Dec 18 12:13:19 2002] [notice] workerJni.Init() Skipping  
initialization for the 4 5527
[Wed Dec 18 12:13:19 2002] [error] workerEnv.initWorkers() init failed  
for worker.jni:onStartup
[Wed Dec 18 12:13:19 2002] [notice] workerJni.Init() Skipping  
initialization for the 4 5527
[Wed Dec 18 12:13:19 2002] [error] workerEnv.initWorkers() init failed  
for worker.jni:onShutdown
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for  
/jkstatus/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples/servlet/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples/*.jsp
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for  
/admin/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for /
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for /
[Wed Dec 18 12:13:19 2002] [notice] workerEnv.init() ok  
/Library/Apache2/conf/workers2.properties
[Wed Dec 18 12:13:19 2002] [notice] vm.open2() done
[Wed Dec 18 12:13:19 2002] [error] workerEnv.initChannel() init failed  
for channel.jni:jni
[Wed Dec 18 12:13:19 2002] [notice] workerJni.Init() Skipping  
initialization for the 1 5524
[Wed Dec 18 12:13:19 2002] [error] workerEnv.initWorkers() init failed  
for worker.jni:onStartup
[Wed Dec 18 12:13:19 2002] [notice] workerJni.Init() Skipping  
initialization for the 1 5524
[Wed Dec 18 12:13:19 2002] [error] workerEnv.initWorkers() init failed  
for worker.jni:onShutdown
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for  
/jkstatus/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples/servlet/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples/*.jsp
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context  
/examples for /examples/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for  
/admin/*
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for /
[Wed Dec 18 12:13:19 2002] [notice] uriMap.init() adding context / for /
[Wed Dec 18 12:13:19 2002] [notice] workerEnv.init() ok  
/Library/Apache2/conf/workers2.properties
[Wed Dec 18 12:13:19 2002] [notice] Loaded  
org/apache/jk/apr/TomcatStarter
[Wed Dec 18 12:13:19 2002] [notice] jni.init() setting  
stdout=/Library/Apache2/logs/stdout.log...
[Wed Dec 18 12:13:19 2002] [notice] jni.init() setting  
stderr=/Library/Apache2/logs/stderr.log...
[Wed Dec 18 12:13:19 2002] [notice] jni.init() ARG start
[Wed Dec 18 12:13:19 2002] [notice] jni.init() calling main()...
[Wed Dec 18 12:13:20 2002] [notice] jni.validate() class=  
org/apache/jk/apr/TomcatStarter
[Wed Dec 18 12:13:20 2002] [notice] Loaded  
org/apache/jk/apr/TomcatStarter
[Wed Dec 18 12:13:20 2002] [notice] jni.init() disabling the non init  
hook worker
[Wed Dec 18 12:13:20 2002] [notice] uriMap.init() adding context / for  
/jkstatus/*
[Wed Dec 18 12:13:20 2002] [notice] uriMap.init() adding context  
/examples for /examples
[Wed Dec 18 12:13:20 2002] [notice] uriMap.init() adding context  
/examples for /examples/servlet/*
[Wed Dec 18 12:13:20 2002] [notice] uriMap.init() adding context  
/examples for /examples/*.jsp
[Wed Dec 18 12:13:20 2002] [notice] uriMap.init() adding context  
/examples for /examples/*
[Wed Dec 18 12:13:20 2002] [notice] uriMap.init() adding context / for  
/admin/*
[Wed Dec 18 12:13:20 2002] [notice] uriMap.init() adding context / for /
[Wed Dec 18 12:13:20 2002] [notice] uriMap.init() adding context / for /
[Wed Dec 18 12:13:20 2002] [notice] workerEnv.init() ok  
/Library/Apache2/conf/workers2.properties
[Wed Dec 18 12:13:20 2002] [error] mod_jk child init 1 0

Regards,

Tony