Bug 42002 - Error when no JkWorkersFile used (JK 1.2.21)
Summary: Error when no JkWorkersFile used (JK 1.2.21)
Status: CLOSED DUPLICATE of bug 41770
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: Common (show other bugs)
Version: unspecified
Hardware: All Linux
: P2 regression (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-30 14:19 UTC by B.Haleblian
Modified: 2008-10-05 03:10 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description B.Haleblian 2007-03-30 14:19:04 UTC
Hi,
As I upgraded from 1.2.19 to 1.2.21, I hit the following regression :
a Wrong [emerg] "Error in reading worker properties" is thrown because I don't
have any JkWorkersFile defined.
mod_jk.c should silently accept this, while the second part of test about empty
map looks correct.
I suggest following fix (wich works for me but may need more test) :

--- mod_jk.c.orig       2007-02-26 20:09:41.000000000 +0100
+++ mod_jk.c    2007-03-30 22:47:31.000000000 +0200
@@ -2658,17 +2658,16 @@
     jk_set_worker_def_cache_size(mpm_threads);

     /*     if(map_alloc(&init_map)) { */
-    if (!jk_map_read_properties(init_map, conf->worker_file, NULL, 1, conf->log)) {
-        if (jk_map_size(init_map) == 0) {
-            ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_CRIT,
-                         0, NULL,
-                         "No worker file and no worker options in httpd.conf"
-                         "use JkWorkerFile to set workers");
-        }
+    if ((conf->worker_file!=NULL) && !jk_map_read_properties(init_map,
conf->worker_file, NULL, 1, conf->log)) {
         ap_log_error(APLOG_MARK, APLOG_EMERG | APLOG_NOERRNO, 0, NULL, "Error
in reading worker properties");
         return !OK;
     }
-
+    if (jk_map_size(init_map) == 0) {
+        ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_CRIT,
+                     0, NULL,
+                     "No worker file and no worker options in httpd.conf"
+                     "use JkWorkerFile to set workers");
+    }
     if (jk_map_resolve_references(init_map, "worker.", 1, 1, conf->log) ==
JK_FALSE) {
         ap_log_error(APLOG_MARK, APLOG_EMERG | APLOG_NOERRNO, 0, NULL, "Error
in resolving configuration references");
         return !OK;
Comment 1 B.Haleblian 2007-03-30 14:33:11 UTC
Some more data about my platform may helps :
32bits RedHat ES4 Update4 (Linux 2.6.9-42.ELsmp) - Apache/2.0.52 - "worker" mode
Comment 2 Mladen Turk 2007-03-31 00:00:53 UTC

*** This bug has been marked as a duplicate of 41770 ***
Comment 3 B.Haleblian 2007-03-31 06:23:07 UTC
(In reply to comment #2)
> 
> *** This bug has been marked as a duplicate of 41770 ***

Oops for not reading BZDB correctly, just missed it, sorry!
Grepping the die message took so close to this quick fix...
Comment 4 Rainer Jung 2008-01-01 17:03:43 UTC
Move a couple of fixed JK issues from resolved to closed.