tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Fisk" <Rick.F...@authoria.com>
Subject [Solution] mod_jk: Could not find a worker for worker name=worker1
Date Wed, 27 Sep 2006 22:23:08 GMT
I was having a bit of trouble with mod_jk1.2.19 and virtual host
configuration in apache 2. 

 

I hope I can shed some light on what I discovered and put this question
to rest. The error message in the subject can be found all over the net
with no helpful responses.I know, I was having this problem and every
post about this problem led to a dead end. In re-stating the problem and
attempting to provide more clues, I found a solution but have no insight
into why this "fixes" the problem.

 

The goal is to hook up apache with tomcat via mod_jk such that I can
have separate domains pointing at distinct deployments in the webapps
directory. 

 

Thus pounding on http://it7.blah.com <http://it7.blah.com/>  would
connect via mod_jk to the tomcat app in ${tomcat.home}/webapps/it7 and
http://it8.blah.com <http://it8.blah.com/>  to
${tomcat.home}/webapps/it8

 

I had successfully configured Tomcat (5.5.16) and mod_jk as evidenced by
my working apps and the mod_jk.conf file that is generated under
${tomcat.home}/conf/auto/

 

The problem arose when configuring apache. My worker.properties file is
located in /etc/httpd/conf/worker.properties and tomcat references it
and apparently understands it well enough to create a mod_jk.conf file
which has a (visually) correct virtual host for every container app in
tomcat. This isn't exactly what I want however, so I am not using it
other than as evidence that parts of this configuration are working
properly.

 

With my configuration( See below), after restarting apache, the
following appears in the mod_jk.log file.

 

[Wed Sep 27 16:01:18 2006] [2867:63648] [debug]
jk_map_resolve_references::jk_map.c (638): Checking for references with
prefix worker. with wildcard (recursion1)

[Wed Sep 27 16:01:18 2006] [2867:63648] [debug]
build_worker_map::jk_worker.c (236): creating worker worker1

[Wed Sep 27 16:01:18 2006] [2867:63648] [debug]
wc_create_worker::jk_worker.c (141): about to create instance worker1 of
ajp13

 

[......]

 

[Wed Sep 27 16:01:18 2006] [2867:63648] [debug]
build_worker_map::jk_worker.c (236): creating worker inprocess

[Wed Sep 27 16:01:18 2006] [2867:63648] [error]
wc_create_worker::jk_worker.c (134): Unknown worker type jni for worker
inprocess --- Huh?

[Wed Sep 27 16:01:18 2006] [2867:63648] [error]
build_worker_map::jk_worker.c (256): failed to create worker inprocess

[Wed Sep 27 16:01:18 2006] [2867:63648] [debug]
close_workers::jk_worker.c (212): close_workers will destroy worker
worker1  <------------------------------- my worker is getting destroyed

[Wed Sep 27 16:01:18 2006] [2867:63648] [debug]
ajp_destroy::jk_ajp_common.c (2131): up to 10 endpoints to close

[Wed Sep 27 16:01:19 2006] [3052:63648] [debug] do_shm_open::jk_shm.c
(252): Shared memory is already open

 

[....]

 

[Wed Sep 27 16:01:19 2006] [3052:63648] [debug] jk_handler::mod_jk.c
(1920): Into handler jakarta-servlet worker=worker1 r->proxyreq=0

[Wed Sep 27 16:01:19 2006] [3052:63648] [debug]
wc_get_worker_for_name::jk_worker.c (111): did not find a worker worker1

[Wed Sep 27 16:01:19 2006] [3052:63648] [info]  jk_handler::mod_jk.c
(2071): Could not find a worker for worker name=worker1

 

This message was originally to be a plea for help and in reviewing the
data and configuration, I discovered that the inprocess worker is in the
worker.properties sample file by default. 

 

worker.list=worker1,inprocess 

 

worker1 is ajp13 in the sample. The problem appears to be that
"inprocess" shouldn't be in the worker.list. When I remove the inprocess
worker from the list, I get the results I was after. It all appears to
work properly now.

 

 

 

Specific (broken) configuration is below. 

 

========================================================================
========================================

>From httpd.conf:

 

JkWorkersFile /etc/httpd/conf/workers.properties

# Where to put the JK logs

JkLogFile /var/log/httpd/mod_jk.log

# jk log level

JkLogLevel debug

# select the log format

JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# JkOptions indicate to send SSL KEY SIZE,

JkOptions     +ForwardKeySize +ForwardURICompat +ForwardDirectories

# JkRequestLogFormat set the request format

JkRequestLogFormat     "%w %V %T"

 

 

In the Virtualhost container:

 

<VirtualHost it7.blah.com>

 

     alias / "/usr/local/tomcat/webapps/it7/"

 

    <Directory "/usr/local/tomcat/webapps/it7/">

       Options Indexes FollowSymLinks

       DirectoryIndex index.jsp

    </Directory>

 

    <Location "/WEB-INF/*">

        AllowOverride None

        deny from all

    </Location>

 

    <Location "/META-INF/*">

        AllowOverride None

        deny from all

    </Location>

 

    JkMount /*.jsp worker1

    JkMount /*.action worker1

    JkMount /*.vm worker1

    JkMount /service/* worker1

 

 

</VirtualHost>

 

worker.list=worker1,inprocess

 

worker.worker1.port=8009

worker.worker1.host=qe-app1.itn.hire.com

worker.worker1.type=ajp13

worker.worker1.lbfactor=1

worker.worker1.connection_pool_size=10

worker.worker1.connection_pool_timeout=600

worker.worker1.socket_keepalive=1

 

worker.loadbalancer.type=lb

worker.loadbalancer.balance_workers=lbworker

 

worker.inprocess.type=jni

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message