You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by James Garrison <jh...@athensgroup.com> on 2006/10/31 20:30:59 UTC
JK 1.2.19 & IIS (Win Server 2003 R2) letter case problem in uriworkermap.properties
With JK 1.2.19 installed on Windows Server 2003 R2, and
given the following in uriworkermap.properties:
/Autoweb=perseus9010
/Autoweb/*=perseus9010
/autoweb=perseus9010
/autoweb/*=perseus9010
Requests are handled as follows:
/Autoweb --> tomcat --> redirect to /Autoweb/
/Autoweb/ --> tomcat --> redirect to /Autoweb/index.html
This is operating correctly. But:
/autoweb --> tomcat --> redirect to /autoweb/
/autoweb/ --> IIS returns 404 (request NOT sent to tomcat)
with an explicit request to /autoweb/index.html IIS also
returns 404 without attempting to send the request to tomcat
via JK.
What is most interesting is that reversing the uriworkermap
entries so the /autoweb lines come first reverses the
behavior. I.e. with
/autoweb=perseus9010
/autoweb/*=perseus9010
/Autoweb=perseus9010
/Autoweb/*=perseus9010
IIS now serves /autoweb correctly but /Autoweb breaks.
Is this a known problem in JK?
--
James Garrison Athens Group, Inc.
mailto:jhg@athensgroup.com 5608 Parkcrest Dr
http://www.athensgroup.com Austin, TX 78731
SKYPE callto:jhg-athensgroup (512) 345-0600 x150
PGP Key ID: 0x22E8DA2A
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: JK 1.2.19 & IIS (Win Server 2003 R2) letter case problem in uriworkermap.properties
Posted by James Garrison <jh...@athensgroup.com>.
A bug has been filed, as requested. The workaround fixed the problem
for me.
Thanks for the quick response!
--
James Garrison Athens Group, Inc.
mailto:jhg@athensgroup.com 5608 Parkcrest Dr
http://www.athensgroup.com Austin, TX 78731
SKYPE callto:jhg-athensgroup (512) 345-0600 x150
PGP Key ID: 0x22E8DA2A
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: JK 1.2.19 & IIS (Win Server 2003 R2) letter case problem in uriworkermap.properties
Posted by Rainer Jung <ra...@kippdata.de>.
It was not knwon (at least not to me) before your mail, but you are
right. We changed URL case sensitivity for mod_jk 1.2.19, because URLs
should be case sensitive, but we missed one place.
Could you please open a bug in bugzilla,
http://issues.apache.org/bugzilla/enter_bug.cgi?product=Tomcat%205
so that we can track the problem more easily? The bug applies to mod_jk
on all platforms and for all web server types. If multiple mount
patterns are equal except for the case, only the first url pattern will
be made active, but with the target worker of the last pattern.
Here's a workaround for your configuration:
/Autoweb=perseus9010
/Autoweb/*=perseus9010
/autoweb|/*=perseus9010
The keys on the left side are used in a case insensitive way as a key in
a hash table. If there are multiple same keys, the first key wins and
the value is set to the last one.
Since mod_jk 1.2.19 there is a convenience notation to combine
/something and /something/*. You can simple write /something|/* which
gets internally resolved as both patterns. Fortunately the hash table is
build early, so that this counts as a different key. It's only a
workaround! We'll fix the bug for the next release.
Thanks for reporting the problem.
Regards,
Rainer
James Garrison schrieb:
> With JK 1.2.19 installed on Windows Server 2003 R2, and
> given the following in uriworkermap.properties:
>
> /Autoweb=perseus9010
> /Autoweb/*=perseus9010
> /autoweb=perseus9010
> /autoweb/*=perseus9010
>
> Requests are handled as follows:
>
> /Autoweb --> tomcat --> redirect to /Autoweb/
> /Autoweb/ --> tomcat --> redirect to /Autoweb/index.html
>
> This is operating correctly. But:
>
> /autoweb --> tomcat --> redirect to /autoweb/
> /autoweb/ --> IIS returns 404 (request NOT sent to tomcat)
>
> with an explicit request to /autoweb/index.html IIS also
> returns 404 without attempting to send the request to tomcat
> via JK.
>
> What is most interesting is that reversing the uriworkermap
> entries so the /autoweb lines come first reverses the
> behavior. I.e. with
>
> /autoweb=perseus9010
> /autoweb/*=perseus9010
> /Autoweb=perseus9010
> /Autoweb/*=perseus9010
>
> IIS now serves /autoweb correctly but /Autoweb breaks.
>
> Is this a known problem in JK?
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: JK 1.2.19 & IIS (Win Server 2003 R2) letter case problem in uriworkermap.properties
Posted by Rainer Jung <ra...@kippdata.de>.
Hi James,
I committed a patch for the problem. If you are able to compile the
plugin, you can check out the file from subversion, or apply the
following patch to version 1.2.19. Check for split mail lines in the patch.
Regards,
Rainer
Index: native/common/jk_map.c
===================================================================
--- native/common/jk_map.c (revision 439824)
+++ native/common/jk_map.c (revision 469665)
@@ -35,17 +35,11 @@
#define JK_MAP_REFERENCE (".reference")
#define JK_MAP_REFERENCE_SZ (strlen(JK_MAP_REFERENCE))
-#ifdef AS400
-#define CASE_MASK 0xbfbfbfbf
-#else
-#define CASE_MASK 0xdfdfdfdf
-#endif
-
/* Compute the "checksum" for a key, consisting of the first
- * 4 bytes, normalized for case-insensitivity and packed into
- * an int...this checksum allows us to do a single integer
+ * 4 bytes, packed into an int.
+ * This checksum allows us to do a single integer
* comparison as a fast check to determine whether we can
- * skip a strcasecmp
+ * skip a strcmp
*/
#define COMPUTE_KEY_CHECKSUM(key, checksum) \
{ \
@@ -67,7 +61,6 @@
c = (unsigned int)*++k; \
checksum |= c; \
} \
- checksum &= CASE_MASK; \
}
struct jk_map
@@ -342,7 +335,7 @@
unsigned int key;
COMPUTE_KEY_CHECKSUM(name, key)
for (i = 0; i < m->size; i++) {
- if (m->keys[i] == key && strcasecmp(m->names[i], name) == 0) {
+ if (m->keys[i] == key && strcmp(m->names[i], name) == 0) {
break;
}
}
@@ -661,7 +654,7 @@
*(to+remain) = '.';
*(to+remain+1) = '\0';
- rc = jk_map_resolve_references(m, m->values[i],
0, ++depth, l);
+ rc = jk_map_resolve_references(m, m->values[i],
0, depth+1, l);
if (rc == JK_FALSE) {
break;
}
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org