-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------

On Mon, 20 September 1999, "Craig R. McClanahan" wrote:

> 
> -----------------------------
> Please read the FAQ!
> <http://java.apache.org/faq/>
> -----------------------------
> 
> [EMAIL PROTECTED] wrote:
> 
> > > >
> > > Apache does it for you ;-) as you can see using a telnet.
> > > It's not JServ's fault ...
> > >
> > > [root@r26m24 logs]# telnet localhost 80
> > > Trying 127.0.0.1...
> > > Connected to localhost.
> > > Escape character is '^]'.
> > > foo
> > > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> > > <HTML><HEAD>
> > > <TITLE>501 Method Not Implemented</TITLE>
> > > </HEAD><BODY>
> > > <H1>Method Not Implemented</H1>
> > > foo to /index.html not supported.<P>
> > > Invalid method in request foo<P>
> > > <HR>
> > > <ADDRESS>Apache/1.3.9 Server at r26m24.cybercable.tm.fr Port
> > > 80</ADDRESS>
> > > </BODY></HTML>
> > > Connection closed by foreign host.
> >
> > Thanks for confirming Jean!!
> >
> > Anyone has any ideas on how to configure Apache to not
> > prepend that line ?
> >
> > thanks
> > Ramesh
> >
> 
> I'm not sure this test proves anything one way or the other, because this is
> Apache reporting a 501 error that never got as far as the servlet engine.
> The error occurs because "foo" is not a valid HTTP command.  Try a command
> like:
> 
>     GET / HTTP/1.0
> 
> or
> 
>     GET /servlet/snoop HTTP/1.0
> 
> where "/servlet/snoop" is the pathname to your servlet, to see what you
> get.  On my Apache system, neither of the above documents has a DOCTYPE
> header.
> 
> However, if I generate an invalid servlet request, such as
> 
>     GET /servlet/foo HTTP/1.0
> 
> where "foo" is not a know servlet, I get an Apache error back instead of my
> text, and the error starts with DOCTYPE.  You need to look at the remainder
> of the text of the message to see if it has your JavaScript text, or an
> error message.
> 
> NOTE:  When using telnet (at least under Linux), you will need to press
> ENTER and then CTRL+J (linefeed) to cause the request to be processed.
> 
> Craig McClanahan
> 
> 
> 


Craig, you are right. Server is returning an error
because there is some intenal error within 
JServ/servlet.  This happens only with javascript.
No problem with HTML.

I see the following error in JServ mod_jserv.log file :

[21/09/1999 06:28:34:900] (EMERGENCY) ajp11: cannot scan servlet headers
[21/09/1999 06:28:34:900] (ERROR) an error returned handling request via protocol 
"ajpv11"

When and why does this error occur ?
This might be too often asked error on this list. But,
I couldn't find relevant info in docs or faqs.

My servlet code is as follows :

import java.io.*;
import java.net.*;
import java.util.*;
import java.lang.reflect.*;

import javax.servlet.*;
import javax.servlet.http.*;

public class MyServlet extends HttpServlet {

    public String getServletInfo() {
        return "MyServlet 1.0 by Ramesh";
    }

    public void doGet(HttpServletRequest req, HttpServletResponse res) 
                                throws IOException {

       MyServletBackend backend = new MyServletBackend();
       backend.doGet(req, res);

    }
}



That's all is in the servlet.  For simplicity, I put everything else in 
MyServletBackend to workaround 
concurrency problems though there is a better way
using  "sychronized"

If I use MyServletBackend directly, this error doesn't
come, however, I face multi threading issues.

Thanks all for your help. I am heading in the
right direction.

Ramesh




--
--------------------------------------------------------------
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