BUG: mod_jk2 can't handle %2f in URL Path

2004-08-31 Thread John Gentilin
After installing mod_jk to test my server under a productions system, I 
found
that if the URI contains a %2f in  the URL path, mod_jk2, or possibly 
Apache,
ignores the URI mapping to the Web Application Server (Tomcat 4.1.30)

Note: I am using the latest source release of mod_jk2, Apache 2.0.50 and
Tomcat 4.1.30.
So say if you have the following mapping in your workers2.properties.
[uri:/myapp/web/*]
and you use the full URL
http://myhost.com/myapp/web/cmd/slash-%2f-slash/
the URI mapping will be completely ignored.  I think if you take any working
URL mapping and insert or append the characters %2f, the mapping will
fail and you will get a 404 error from Apache, not Tomcat where you would
expect it.
Now I hesitate and think it may be an Apache bug because if the 2f shows up
as part of the value for a parameter, the URI mapping will succeed. i.e.
http://myhost.com/myapp/web/cmd/slash/?p1=slash-%2f-slash
Works just fine, its only when the %2f shows up up in the path section 
of the URI.

Also when I test my servlet under the standalone (port 8080) listener, 
the system
works just fine and the 2f in the URL path works just fine.

-JG

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


Re: Catalina and log4j

2001-04-22 Thread John Gentilin

My two cents as a Log4J User.

I use Log4J in my servlets and I think it great. Logging has never been so easy.
One issue though, the Configurator class holds it data in a Static variable so
two servlets inside the same JVM will each over write the others config. Even
since I implemented Log4J I was worried that my servlets may not play well
with others when trying to deploy at an ISP. Also will you be able to support
one Servlet using a PropertyConfigurastion as opposed to a XMLConfigurator.

A word to the wise, one of our biggest hurdles was where or when to use each
level. i.e. Debug,Info,warn.. It is easy to always use Info or Debug which defeats
the purpose of separate levels. We had to create a standards document that defined
where to implement each. It was surprising how often I need to look at the document
to make the right choice.

Regards
John G

Ceki Glc wrote:

 Hello,

 I am toying with the idea of migrating catalina logging to log4j. Let me begin by 
saying that I am far from being familiar with catalina internals but I am getting 
there slowly.

 After a short initial study and some experimentation, here are some tentative 
conclusions:

 1) The way logging is done currently in catalina is not optimal or, in plain 
English, sucks. Like most project using their own logging API, there are real 
benefits in using a more specialized package like log4j instead of the home-brewed 
solution. More on this below.

 2) Since catalina uses its own class loader, it would be possible to have catalina 
use log4j for logging without affecting other parts of Tomcat. This is probably not 
entirely true since Tomcat uses a logging hierarchy. I'll ignore this issue for the 
time being until I understand the implications. More importantly, existing servelets 
using log4j will be unaffected because they will be using a classloader in a 
different branch of the cl-tree.

 Benefits of the move to log4j would be:

 - No more need to do

   if(debug  1)
 log("Some message");

 instead one would write

   log.debug("Some message");

 where log is an instance of org.apache.log4j.Category.

 - No more need to have a log() method in each catelina class, as in

private static void log(String message) {
 System.out.print("Bootstrap: ");
 System.out.println(message);
 }

 in Bootstrap.java. Log4j would use the category name to identify the source of the 
log statement.

 -  Instead of

try {
   } catch (IOException e) {
   System.out.println("Cannot create URL for " +
   filenames[i]);
e.printStackTrace(System.out);
   }

 one would write

  try {
   } catch (IOException e) {
   log.error("Cannot create URL for " + filenames[i], e);
   }

 One advantage is that the code becomes shorter. More importantly, the error can be 
reported to any defined log4j appender attached to "log" category instance not just 
to System.out.

 - The user would configure logging in Tomcat using a separate configuration file, 
simplifying the actual Tomcat configuration. I am assuming that the DTD for 
sevlet.xml is not part of the Servlet spec so it can be modified without fear of 
contradicting the spec.

 Anyway, I am still studying the problem but it looks pretty encouraging for the 
moment. Your comments are welcome. Ceki


 --
 Ceki Glc

--

--
John Gentilin
Eye Catching Solutions Inc.
18314 Carlwyn Drive
Castro Valley CA 94546

Contact Info
[EMAIL PROTECTED]
Phone 1-510-881-4821
--