----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

Server Version: Apache/1.3.12 (Unix) Red-Hat-Secure/3.2.1
                ApacheJServ/1.1.1 mod_ssl/2.6.4 BSAFE-SSL-C/1.0.0i

OS Version: RH6.2 kernel 2.2.14-12

Java: JDK 1.1.8 IBM build l118-20000325

Problem:
Occasionally, I am seeing a 500 response code, when I should be seeing 404.
I'm seeing this as I test error catching code, checking the request for a
malformed request.  A test program generates the same malformed request and
sends it twice in rapid succession to the servlet.  Sometimes both requests
will generate a 500 response code.  Sometimes both requests will generate a
404 response code (which they should).  And even more confusing, sometimes
one request will be 500, and the other 404.

Based on the code below, anytime there's PATH_INFO that isn't "/log" I
should see a 404 (not 500) response code.  And based on the logs shown
below, the 500 error is being created outside of my servlet since the last
thing before the return statement is a logging call, the output of which is
seen in the log.  In the logs shown below, in this test run, I got
404(expected answer) and 500(what the?!?!).  In other cases I'll get 2 404s
or 2 500s.

Can anyone offer any clue as to what in the wide wide world of sports is
goin on here?

Source:
    public void doPost(HttpServletRequest req,
                       HttpServletResponse resp)
        throws ServletException, java.io.IOException
    {
        String pathinfo;
        if ((pathinfo = req.getPathInfo()) != null) {
            if (pathinfo.equals("/log")) {
                log(req, "Client-side logging enabled");
            } else {
                resp.sendError(HttpServletResponse.SC_NOT_FOUND);
                log(req, "Received PATH_INFO: " + pathinfo);
                return;
            }
        }
        pathinfo = null;

access-log:
209.249.186.217 - - [07/Jun/2000:16:52:57 -0400] "POST /proxy/test/logggin
HTTP/1.1" 404 292
209.249.186.217 - - [07/Jun/2000:16:52:57 -0400] "POST /proxy/test/logggin
HTTP/1.1" 500 616

jserv.log:
[07/06/2000 16:52:57:168 EDT] test/com.surety.NotaryServlet:
[client:209.249.186.217] Received PATH_INFO: /logggin
[07/06/2000 16:52:57:180 EDT] test/com.surety.NotaryServlet:
[client:209.249.186.217] Received PATH_INFO: /logggin

error_log:
[Wed Jun  7 16:52:57 2000] [error] [client 209.249.186.217] Premature end of
script headers: /proxy/test

mod_jserv.log:
[07/06/2000 16:52:57:170] (ERROR) ajp12: Servlet Error: Not Found
[07/06/2000 16:52:57:182] (EMERGENCY) ajp12[1]: cannot scan servlet headers
(500)
[07/06/2000 16:52:57:182] (ERROR) an error returned handling request via
protocol "ajpv12"



--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to