mod_jk2 inprocess tomcat / apache

2003-04-02 Thread Rob Shortt
Hi everyone.  This is a long message so please bear with me. :)

I am attempting to get tomcat running 'inprocess' from mod_jk2 under 
apache on solaris.  I am getting random results, which is very annoying, 
hopefully someone can help.

Versions:
os: sparc solaris 8, 32 bit
apache-2.0.44
tomcat-4.1.24
mod_jk2 from jakarta-tomcat-connectors-4.1.24-src
java - j2se-1.4.1-b21
I wish to use the inprocess method of running tomcat because I would 
like my users to not have to maintain a 'running' tomcat server as well 
as apache.

I have a few problems, which probably stem from a larger problem.

When I start apache, tomcat doesn't always get started, but does 
sometimes!  When starting apache I see in the error_log:

[Wed Apr 02 13:59:13 2003] [error] workerEnv.initChannel() init failed 
for channel.jni:jni
[Wed Apr 02 13:59:13 2003] [error] workerEnv.initWorkers() init failed 
for worker.jni:onStartup
[Wed Apr 02 13:59:13 2003] [error] workerEnv.initWorkers() init failed 
for worker.jni:onShutdown
[Wed Apr 02 13:59:13 2003] [error] mod_jk child init 1 -2

I see a group of these messages for every apache thread that is started. 
 Most of the time I get a bunch of these and tomcat does not get 
started.  I then stop apache, then restart it... if I am lucky I may 
only get a couple groups of these failure messages then a success, 
tomcat gets started:

[Wed Apr 02 14:01:00 2003] [error] workerEnv.initChannel() init failed 
for channel.jni:jni
[Wed Apr 02 14:01:00 2003] [error] workerEnv.initWorkers() init failed 
for worker.jni:onStartup
[Wed Apr 02 14:01:00 2003] [error] workerEnv.initWorkers() init failed 
for worker.jni:onShutdown
TomcatStarter: main()
Try  org.apache.tomcat.startup.Main
Try  org.apache.catalina.startup.BootstrapService
[Wed Apr 02 14:01:01 2003] [error] mod_jk child init 1 0
Starting org.apache.catalina.startup.BootstrapService
Created catalinaLoader in: /opt/jakarta-tomcat-4.1.24/server/lib
Apr 2, 2003 2:01:05 PM org.apache.commons.modeler.Registry loadRegistry
INFO: Loading registry information
Apr 2, 2003 2:01:05 PM org.apache.commons.modeler.Registry getRegistry
INFO: Creating new Registry instance
Apr 2, 2003 2:01:07 PM org.apache.commons.modeler.Registry getServer
INFO: Creating MBeanServer
Apr 2, 2003 2:01:42 PM org.apache.jk.apr.AprImpl init
INFO: JK2: Initialized apr
Apr 2, 2003 2:01:42 PM org.apache.jk.common.ChannelJni init
INFO: JK2: listening on channel.jni:jni
Apr 2, 2003 2:01:42 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Apr 2, 2003 2:01:42 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=3/230 
config=/opt/jakarta-tomcat-4.1.24/conf/jk2.properties

I also see activity in my tomcat based application log.  I have 
identical results with the examples context.

Now, when it DOES load I only occasionally get a valid response.  I hit 
http://localhost/examples/servlets/index.html and see the page 
displayed, only with a few broken images.  I do a shift-reload and some 
of the proken images appear, but others become broken.  I hit 
shift-reload a few times and I get the occasional internal server error 
from apache.  When either of these occur I see in the error_log:

[Wed Apr 02 14:14:37 2003] [error] lb_worker.service() all workers in 
error or disabled state
[Wed Apr 02 14:14:37 2003] [error] mod_jk.handler() Error connecting to 
tomcat 12
[Wed Apr 02 14:14:37 2003] [error] lb_worker.service() all workers in 
error or disabled state
[Wed Apr 02 14:14:37 2003] [error] mod_jk.handler() Error connecting to 
tomcat 12

I have read other people's posts about mod_jk2 and inprocess but have 
not seen any reported problems such as these.

Now for some information on my configuration.

workers2.properties:

[shm:]
info=Scoreboard.
file=/opt/apache/logs/jk2.shm
size=100
debug=9
disabled=0
[channel.jni:jni]
info=The jni channel, used if tomcat is started inprocess
[vm:]
info=Parameters used to load a JVM in the server process
JVM=/opt/j2se/jre/lib/sparc/libjvm.so
classpath=/opt/jakarta-tomcat-4.1.24/bin/tomcat-jni.jar
classpath=/opt/jakarta-tomcat-4.1.24/server/lib/catalina-ant.jar
classpath=/opt/jakarta-tomcat-4.1.24/server/lib/catalina.jar
classpath=/opt/jakarta-tomcat-4.1.24/server/lib/commons-beanutils.jar
classpath=/opt/jakarta-tomcat-4.1.24/server/lib/commons-digester.jar
classpath=/opt/jakarta-tomcat-4.1.24/server/lib/commons-logging.jar
classpath=/opt/jakarta-tomcat-4.1.24/server/lib/commons-modeler.jar
classpath=/opt/jakarta-tomcat-4.1.24/server/lib/jaas.jar
classpath=/opt/jakarta-tomcat-4.1.24/server/lib/jakarta-regexp-1.2.jar
classpath=/opt/jakarta-tomcat-4.1.24/server/lib/mx4j-jmx.jar
classpath=/opt/jakarta-tomcat-4.1.24/server/lib/servlets-cgi.jar
classpath=/opt/jakarta-tomcat-4.1.24/server/lib/servlets-common.jar
classpath=/opt/jakarta-tomcat-4.1.24/server/lib/servlets-default.jar
classpath=/opt/jakarta-tomcat-4.1.24/server/lib/servlets-invoker.jar

RE: mod_jk2 inprocess tomcat / apache

2003-04-02 Thread Mladen Turk


 -Original Message-
 From: Rob Shortt [mailto:[EMAIL PROTECTED] 
 Sent: 2. travanj 2003 20:27
 To: [EMAIL PROTECTED]
 Subject: mod_jk2 inprocess tomcat / apache
 
 
 
 Hi everyone.  This is a long message so please bear with me. :)
 
 I am attempting to get tomcat running 'inprocess' from mod_jk2 under 
 apache on solaris.  I am getting random results, which is 
 very annoying, 
 hopefully someone can help.
 
 Versions:
 os: sparc solaris 8, 32 bit
 apache-2.0.44
 tomcat-4.1.24
 mod_jk2 from jakarta-tomcat-connectors-4.1.24-src
 java - j2se-1.4.1-b21
 

Assure you have only one child process.
The inprocess won't work for prefork, and perchild mpm's.
It can work with worker mpm if you config Apache to use the single child
process.

The problem is that the TC is started for every child and only one can
succeed to start (first).
So that gives you those weird responses.

MT.
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mod_jk2 inprocess tomcat / apache

2003-04-02 Thread Rob Shortt
Mladen Turk wrote:
Assure you have only one child process.
The inprocess won't work for prefork, and perchild mpm's.
It can work with worker mpm if you config Apache to use the single child
process.
The problem is that the TC is started for every child and only one can
succeed to start (first).
So that gives you those weird responses.
Thanks for the insight, Mladen.

I have recompiled apache with the worker mpm and in my httpd.conf I have:
IfModule worker.c
StartServers 1
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild  0
/IfModule
'Just in case' I have also rebuilt mod_jk2.  I then start apache and get 
this in my error log:

[Wed Apr 02 17:48:39 2003] [error] jk2_init() Can't find child 7050 in 
scoreboard
[Wed Apr 02 17:48:39 2003] [notice] Apache/2.0.44 (Unix) mod_ssl/2.0.44 
OpenSSL/0.9.6g mod_jk2/2.0.3-dev configured -- resuming normal operations
[Wed Apr 02 17:48:40 2003] [error] jk2_init() Can't find child 7051 in 
scoreboard
[Wed Apr 02 17:48:41 2003] [error] jk2_init() Can't find child 7052 in 
scoreboard
[Wed Apr 02 17:48:41 2003] [error] jk2_init() Can't find child 7053 in 
scoreboard
[Wed Apr 02 17:48:42 2003] [error] jk2_init() Can't find child 7054 in 
scoreboard
[Wed Apr 02 17:48:42 2003] [error] jk2_init() Can't find child 7055 in 
scoreboard
[Wed Apr 02 17:48:42 2003] [error] jk2_init() Can't find child 7056 in 
scoreboard
[Wed Apr 02 17:48:42 2003] [error] jk2_init() Can't find child 7057 in 
scoreboard

Every second 3-5 of these messages spam the log, continuously.  Tomcat 
is never loaded.

Question:  Should the ScoreBoardFile directive in httpd.conf be the same 
scoreboard file as the shm section in jk2.properties and 
workers2.properties?  As far as I know apache doesn't use ScoreBoardFile 
for a single process setup, and either should mod_jk2.  I tried mod_jk2 
with the shm disabled in the two relevant files but it just complained. 
 Also I tried using the same file as ScoreBoardFile pointed to.  None 
of these compinations work.

Can anyone shed some light on why I am getting totally spammed with 
these messages now?  In testing I tried setting all of: MaxClients 
MinSpareThreads MaxSpareThreads ThreadsPerChild to 1, then I only got 
about 1 can't find child message per second.

Thanks again,
Rob
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: mod_jk2 inprocess tomcat / apache

2003-04-02 Thread Mladen Turk


 -Original Message-
 From: Rob Shortt [mailto:[EMAIL PROTECTED] 
 Sent: 3. travanj 2003 0:01
 To: Tomcat Users List
 Subject: Re: mod_jk2 inprocess tomcat / apache
 
 
 Mladen Turk wrote:
  Assure you have only one child process.
  The inprocess won't work for prefork, and perchild mpm's.
  It can work with worker mpm if you config Apache to use the single 
  child process.
  
  The problem is that the TC is started for every child and 
 only one can 
  succeed to start (first). So that gives you those weird responses.
 
 Thanks for the insight, Mladen.
 
 I have recompiled apache with the worker mpm and in my 
 httpd.conf I have: IfModule worker.c
 StartServers 1
 MaxClients 150
 MinSpareThreads 25
 MaxSpareThreads 75
 ThreadsPerChild 25
 MaxRequestsPerChild  0
 /IfModule


Yes, but you still have MaxClients/ThreadsPerChild child processes,
meaning 6.
 
 
 Every second 3-5 of these messages spam the log, 
 continuously.  Tomcat 
 is never loaded.
 

Your child JVM segfaults and makes apache to recycle the affected child.
See if you've correctly set the LD_LIBRARY_PATH (needs to find the
libapr, etc...).
Best way to check your config is to start the Apache in debug mode
(single process).
If you'll able to use the jk2 in that mode start playing with the
config.
Set the ThreadsPerChild to be equal to MaxClients, and then set the
ServerLimit to 1. 


MT.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]