You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Mike Lloyd <ml...@fore.com> on 1999/12/01 16:03:58 UTC

mod_jserv/5401: Intermitent bad request when servlet is run

>Number:         5401
>Category:       mod_jserv
>Synopsis:       Intermitent bad request when servlet is run
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jserv
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Wed Dec  1 07:10:02 PST 1999
>Last-Modified:
>Originator:     mlloyd@fore.com
>Organization:
apache
>Release:        Apache/1.3.9 + ApacheJServ/1.1b3
>Environment:
UNIX, Solaris
>Description:
ERROR MESSAGE -- [30/11/1999 16:33:05:282] (ERROR) ajp12: Servlet Error: GET is not supported by this URL

SYNOPSIS: After restarting the apache web server and jserv, the servlet below (ExtendedServlet) intermitently fails with above error message. Once it has failed once (see above error message) it continues to fail until another servlet is loaded. After that, ExtendedServlet executes normally.

CODE:
-----------------------------------------------------------------------------
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class TestServlet extends BaseServlet {

    public void init(ServletConfig config) throws ServletException {
        super.init(config);
    }

    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {

        response.setContentType("text/html");
        ServletOutputStream out = response.getOutputStream();        
        out.println("POST REQUEST");
        out.close();

    }

    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {
            
        response.setContentType("text/html");
        ServletOutputStream out = response.getOutputStream();        
        out.println("GET REQUEST");
        out.close();        
            
  }
}

-----------------------------------------------------------------------------
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;


public abstract class BaseServlet extends HttpServlet {

    public void init(ServletConfig config) throws ServletException {
        super.init(config);
    }

    //Abstract classes to be implemented
    public abstract void doGet(HttpServletRequest request,
        HttpServletResponse response) throws IOException, ServletException;
        
    public abstract void doPost(HttpServletRequest request,
            HttpServletResponse response)throws IOException, ServletException;

}
>How-To-Repeat:
I have been able to repeat this problem by:
1. restarting the web server (& jserv)
2. making repeated requests to ExtendedServlet
>Fix:
Not at present.
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <ap...@Apache.Org> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or      ]
["Re: general/1098:").  If the subject doesn't match this       ]
[pattern, your message will be misfiled and ignored.  The       ]
["apbugs" address is not added to the Cc line of messages from  ]
[the database automatically because of the potential for mail   ]
[loops.  If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request from a  ]
[developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]