You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Keim, Markus" <ma...@ordat.com> on 2003/04/25 11:28:30 UTC

Tomcat 4.1 / Apache 2 / JK2 / JNI channel / Win32: Anyone succee d?

Hello @all,

As the subject says i'm trying to get Tomcat 4.1 connected to
Apache 2 inprocess, using the JNI channel of JK2.

Environment:
Win32 (Windows 2k pro SP3)
JDK 1.4.0_01
Tomcat 4.1.24
Apache 2.0.45
mod_jk2-2.0.43.dll
(jkjni.dll)

I've tried any information and tip i was able to find,
of course http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/,
but apparently there is no way to get Apache and Tomcat connected
inprocess using the suggested propertie files.
I've took all the steps suggested in
http://www.gregoire.org/howto/Apache2_Jk2_TC4.1.x_JSDK1.4.x.html
but with no success, although it seems much more promising as the
above mentioned documentation.
And, last but not least, i've searched this list and found many
threads regarding similar or equal problems, found and tried
several tips and proposals but alas no solution that works for me.

So, i ask myself (and all of you): Is there anybody who has managed
it to get Tomcat 4.1 connected to Apache 2 on Win32 using JK2 with
JNI channel?
If so, i would be glad to see the propertie files and / or hear about
the magic that it takes to make it work.
If not, are there informations i'm still missing, e.g. are there
informations if it's actually possible (i've found an entry in the
Tomcat bug database
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16974that
supposes that it's *not* possible due to a bug in JK2, but it's
discussed controversial).

I've attached the error and log messages from Apache / Tomcat
as well as the propertie files i'm curretly using.

Many thanks in advance for your efforts and
Ciao, Markus


Error message when i try to access Tomcats "examples" application:
================================================================
The servlet container is temporary unavailable or being upgraded 
Internal Server Error
The server encountered an internal error or misconfiguration and was unable
to complete your request.
================================================================


This is Apache error log after starting and trying to access
"/examples":
================================================================
[Fri Apr 25 10:57:46 2003] [notice] Parent: Created child process 2864
[Fri Apr 25 10:57:46 2003] [warn] module jk2_module is already loaded,
skipping
[Fri Apr 25 10:57:47 2003] [notice] Child 2864: Child process is running
[Fri Apr 25 10:57:47 2003] [notice] Child 2864: Acquired the start mutex.
[Fri Apr 25 10:57:48 2003] [notice] Child 2864: Starting 250 worker threads.
================================================================


And this the JK2 log:
================================================================
[Fri Apr 25 10:57:46 2003] ( info ) [jk_logger_file.c (184)]  Initializing
log file c:/Programme/Apache Group/Apache2/logs/jk2.log
[Fri Apr 25 10:57:47 2003] ( info ) [jk_logger_file.c (184)]  Initializing
log file c:/Programme/Apache Group/Apache2/logs/jk2.log
[Fri Apr 25 10:57:47 2003] ( info ) [jk_logger_file.c (184)]  Initializing
log file c:/Programme/Apache Group/Apache2/logs/jk2.log
[Fri Apr 25 10:57:47 2003] ( info ) [jk_vm_default.c (500)]  vm.init(): Jni
lib: C:\Programme\Java\j2re1.4.0_01\bin\client\jvm.dll
[Fri Apr 25 10:57:47 2003] ( info ) [jk_vm_default.c (607)]  vm.open2() done
[Fri Apr 25 10:57:47 2003] ( info ) [jk_worker_jni.c (252)]  jni.validate()
class= org/apache/jk/apr/TomcatStarter 
[Fri Apr 25 10:57:47 2003] ( info ) [jk_worker_jni.c (297)]  Loaded
org/apache/jk/apr/TomcatStarter
[Fri Apr 25 10:57:47 2003] ( info ) [jk_worker_jni.c (335)]  jni.init()
setting stdout=c:/Programme/Apache Group/Apache2/logs/stdout.log...
[Fri Apr 25 10:57:47 2003] ( info ) [jk_worker_jni.c (344)]  jni.init()
setting stderr=c:/Programme/Apache Group/Apache2/logs/stderr.log...
[Fri Apr 25 10:57:47 2003] ( info ) [jk_worker_jni.c (361)]  jni.init() ARG
start
[Fri Apr 25 10:57:47 2003] ( info ) [jk_worker_jni.c (367)]  jni.init()
calling main()...
[Fri Apr 25 10:57:47 2003] ( info ) [jk_worker_jni.c (252)]  jni.validate()
class= org/apache/jk/apr/TomcatStarter 
[Fri Apr 25 10:57:47 2003] ( info ) [jk_worker_jni.c (297)]  Loaded
org/apache/jk/apr/TomcatStarter
[Fri Apr 25 10:57:47 2003] ( info ) [jk_worker_jni.c (378)]  jni.init()
disabling the non init hook worker
[Fri Apr 25 10:57:47 2003] ( info ) [jk_workerEnv.c (403)]  workerEnv.init()
ok C:/Programme/Apache Group/Apache2/conf/workers2.properties
[Fri Apr 25 10:57:47 2003] (error ) [mod_jk2.c (557)]  mod_jk child init 1 0
[Fri Apr 25 10:58:03 2003] ( info ) [jk_shm.c (478)]  shm.createSlot()
Create 1 0x930000 0x932000
[Fri Apr 25 10:58:03 2003] ( info ) [jk_endpoint.c (95)]  workerEnv.init()
create slot epStat.0
[Fri Apr 25 10:58:03 2003] ( info ) [jk_channel_jni.c (170)]
channel_jni.open():  
[Fri Apr 25 10:58:03 2003] (error ) [jk_channel_jni.c (261)]
channel_jni.open() Can't create java context
[Fri Apr 25 10:58:03 2003] (error ) [jk_channel_jni.c (406)]
channel_jni.send() no java context
[Fri Apr 25 10:58:03 2003] ( info ) [jk_vm_default.c (340)]  vm.detach() ok
[Fri Apr 25 10:58:03 2003] ( info ) [jk_channel_jni.c (358)]
channel_jni.close() ok
[Fri Apr 25 10:58:03 2003] (error ) [jk_worker_ajp13.c (512)]
ajp13.service() Error  forwarding ajp13:jni 1 0
[Fri Apr 25 10:58:03 2003] (error ) [jk_worker_lb.c (402)]  lb.service()
worker failed 120000 for ajp13:jni
[Fri Apr 25 10:58:03 2003] ( info ) [jk_worker_lb.c (217)]  lb.getWorker()
All workers in error state, use the one with oldest error
[Fri Apr 25 10:58:03 2003] ( info ) [jk_worker_lb.c (248)]  lb.getWorker()
We tried all possible workers 1
[Fri Apr 25 10:58:03 2003] (error ) [jk_worker_lb.c (348)]
lb_worker.service() all workers in error or disabled state
[Fri Apr 25 10:58:03 2003] ( info ) [jk_vm_default.c (340)]  vm.detach() ok
[Fri Apr 25 10:58:03 2003] ( info ) [jk_vm_default.c (340)]  vm.detach() ok
[Fri Apr 25 10:58:03 2003] (error ) [mod_jk2.c (678)]  mod_jk.handler()
Error connecting to tomcat 120000
================================================================


workers2.properties
================================================================
[logger]
level=ERROR

[config:]
file=c:/Programme/Apache Group/Apache2/conf/workers2.properties
debug=3
debugEnv=3

[uriMap:]
info=Maps the requests. Options: debug
debug=3

# Alternate file logger
[logger.file:0]
level=INFO
file=c:/Programme/Apache Group/Apache2/logs/jk2.log

# Shared memory handling. Needs to be set.
[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess
servers
file=E:/java/Tomcat-4.1.24/work/jk2.shm
size=1000000
debug=3
disabled=0

[workerEnv:]
info=Global server options
timing=1
debug=3
# Default Native Logger (apache2 or win32 ) 
# can be overriden to a file logger, useful 
# when tracing win32 related issues
logger=logger.file:0

[lb:lb]
info=Default load balancer.
debug=0

#[channel.socket:localhost:8009]
#info=Ajp13 forwarding over socket
#debug=3
#tomcatId=localhost:8009

[channel.jni:jni]
info=The jni channel, used if tomcat is started inprocess

[status:]
info=Status worker, displays runtime informations

[vm:]
info=Parameters used to load a JVM in the server process
#JVM=C:\jdk\jre\bin\hotspot\jvm.dll
OPT=-Djava.class.path=E:/java/Tomcat-4.1.24/bin/tomcat-jni.jar;E:/java/Tomca
t-4.1.24/server/lib/catalina.jar;E:/java/Tomcat-4.1.24/server/lib/commons-di
gester.jar;E:/java/Tomcat-4.1.24/server/lib/commons-logging.jar;E:/java/Tomc
at-4.1.24/server/lib/tomcat-util.jar;E:/java/Tomcat-4.1.24/common/lib/common
s-collections.jar;E:/java/Tomcat 4.1.24/common/lib/naming-common.jar
OPT=-Dtomcat.home=E:/java/Tomcat-4.1.24
OPT=-Dcatalina.home=E:/java/Tomcat-4.1.24
OPT=-Xmx128M
disabled=0

[worker.jni:onStartup]
info=Command to be executed by the VM on startup. This one will start
tomcat.
class=org/apache/jk/apr/TomcatStarter
ARG=start
disabled=0
stdout=c:/Programme/Apache Group/Apache2/logs/stdout.log
stderr=c:/Programme/Apache Group/Apache2/logs/stderr.log

[worker.jni:onShutdown]
info=Command to be executed by the VM on shutdown. This one will stop
tomcat.
class=org/apache/jk/apr/TomcatStarter
ARG=stop
disabled=0

[uri:/jkstatus/*]
info=Display status information and checks the config file for changes.
group=status:

[uri:/examples/*]
info=Map the whole webapp
================================================================


jk2.properties
================================================================
# list of needed handlers.
handler.list=apr,request,channelJni

# The default port is 8009 but you can use another one
#channelSocket.address=127.0.0.1
#channelSocket.port=8009

# Shared memory handling. Needs to be set.
shm.file=E:/java/Tomcat 4.1.24/work/jk2.shm

# Dynamic library needs to be defined only if Tomcat is used
# out of process
#jtc=/home1/jakarta/jakarta-tomcat-connectors
#apr.NativeSo=${jtc}/jk/build/jk2/apache2/jkjni.so
# Or you can use the mod_jk2 directly
apr.jniModeSo=c:/Programme/Apache Group/Apache2/modules/mod_jk2.so

# In order to enable jni use any channelJni directive
channelJni.disabled = 0

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

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org