----- Original Message ----- From: "Bo Xu" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Tuesday, December 04, 2001 6:41 PM Subject: Re: HTTP method POST is not supported by this URL
> ----- Original Message ----- > From: "Jim Urban" <[EMAIL PROTECTED]> > To: "Tomcat Users List" <[EMAIL PROTECTED]> > Sent: Tuesday, December 04, 2001 4:07 PM > Subject: RE: HTTP method POST is not supported by this URL > > > > > So, doPost calls itself in an endless loop, sending the servlet into > > oblivion... > > Or until a java.lang.StackOverflowError exception is thrown. :) > > > > Seriously, if a servlet gets a StackOverflowError does that impact Tomcat? > > That is, can Tomcat run out of stack space if a loop in a servlet gets out > > of control. > > > > Jim > >[...] > > > > I am testing it :-) > * the following is my code: > public class Test0 extends HttpServlet { > public void service(HttpServletRequest req, HttpServletResponse res) > throws ServletException, IOException { > res.setContentType("text/html"); > PrintWriter out = res.getWriter(); > m(); > out.println("hahahahaha"); > out.close(); out=null; > } > private void m(){ > m(); > } > } > > * the following is the result: > - when I first invoke Test0, I got the following output in my browser > - then I can invoke MyServlet class(es) > - but if I invoke Test0 _again_, the "DOS prompt" of TC4.0 closed by > itself !! (I didn't > use "shutdown" commond to close it) > > * output: > A Servlet Exception Has Occurred > Exception Report: > javax.servlet.ServletException: Invoker service() exception > at org.apache.catalina.servlets.InvokerServlet.serveRequest(Unknown Source) > at org.apache.catalina.servlets.InvokerServlet.doGet(Unknown Source) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown > Source) > at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source) > at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source) > at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source) > at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source) > at org.apache.catalina.core.ContainerBase.invoke(Unknown Source) > at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source) > at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source) > at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source) > at org.apache.catalina.core.ContainerBase.invoke(Unknown Source) > at org.apache.catalina.core.StandardContext.invoke(Unknown Source) > at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source) > at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source) > at org.apache.catalina.valves.AccessLogValve.invoke(Unknown Source) > at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source) > at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source) > at org.apache.catalina.core.ContainerBase.invoke(Unknown Source) > at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source) > at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source) > at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source) > at org.apache.catalina.core.ContainerBase.invoke(Unknown Source) > at org.apache.catalina.connector.http.HttpProcessor.process(Unknown Source) > at org.apache.catalina.connector.http.HttpProcessor.run(Unknown Source) > at java.lang.Thread.run(Thread.java:484) > > Root Cause: > java.lang.StackOverflowError > at Test0.m(Test0.java:23) > at Test0.m(Test0.java:23) > at Test0.m(Test0.java:23) > at Test0.m(Test0.java:23) > at Test0.m(Test0.java:23) > ... > (many...) > > > > Bo > Dec.04, 2001 >[...] my another testing result: if I throw a permanent UnavailableException by myself from service(...), I got the following "output" in my browser: HTTP Status 503 - Servlet invoker is currently unavailable The requested service (Servlet invoker is currently unavailable) is not currently available. and I can invoke it again(I still get the same "output"), the "DOS prompt" of TC4.0 doesn't closed by itself. But for the java.lang.StackOverflowError(please see above email), the "DOS prompt" of TC4.0 closed by itself. testing code: public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); out.println("another testing"); throw new UnavailableException("permanent msg"); } } Bo Dec.04, 2001 -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>