You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by BugRat Mail System <to...@cortexity.com> on 2000/09/15 22:14:29 UTC

BugRat Report #124 has been filed.

Bug report #124 has just been filed.

You can view the report at the following URL:

   <http://znutar.cortexity.com:8888/BugRatViewer/ShowReport/124>

REPORT #124 Details.

Project: Tomcat
Category: Bug Report
SubCategory: New Bug Report
Class: swbug
State: received
Priority: medium
Severity: non-critical
Confidence: public
Environment: 
   Release: Tomcat 3.2b4
   JVM Release: jdk1.2.2
   Operating System: linux
   OS Release: redhat 6.2
   Platform: x86

Synopsis: 
IllegalStateException when error in jsp servlet include encountered

Description:
If a jsp page references a servlet after including some other content, and gets a ClassNotFoundException on that servlet, an IllegalStateException occurs during a buffer reset.
This error is very misleading, and doesn't point to the classpath or servlet setup in web.xml as the cause. It looks like it's an internal error in Tomcat
instead of a simple configuration error.

Stacktraces:

Location:/test/foobar.jsp

Internal Servlet Error:

javax.servlet.ServletException: can't reset buffer after writing to client
        at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:448)
        at _0002ffoobar_0002ejspfoobar_jsp_1._jspService(_0002ffoobar_0002ejspfoobar_jsp_1.java:75)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:382)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387)
        at org.apache.tomcat.core.Handler.service(Handler.java:263)
        at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
        at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:749)
        at org.apache.tomcat.core.ContextManager.service(ContextManager.java:695)
        at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:207)
        at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403)
        at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
        at java.lang.Thread.run(Thread.java:475)

Root cause: 

java.lang.IllegalStateException: can't reset buffer after writing to client
        at org.apache.tomcat.core.BufferedServletOutputStream.reset(BufferedServletOutputStream.java:296)
        at org.apache.tomcat.core.ResponseImpl.resetBuffer(ResponseImpl.java:395)
        at org.apache.tomcat.core.ContextManager.handleStatus(ContextManager.java:953)
        at org.apache.tomcat.core.Handler.service(Handler.java:249)
        at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
        at org.apache.tomcat.facade.RequestDispatcherImpl.include(RequestDispatcherImpl.java:308)
        at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:407)
        at _0002ffoobar_0002ejspfoobar_jsp_1._jspService(_0002ffoobar_0002ejspfoobar_jsp_1.java:65)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:382)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387)
        at org.apache.tomcat.core.Handler.service(Handler.java:263)
        at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
        at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:749)
        at org.apache.tomcat.core.ContextManager.service(ContextManager.java:695)
        at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:207)
        at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403)
        at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
        at java.lang.Thread.run(Thread.java:475)

Re: BugRat Report #124 has been filed.

Posted by Danno Ferrin <sh...@earthlink.net>.
This is definatly a usability issue, since the real cause of the error is
well hidden from view.  At the very least there should be another root cause
attributing the ClassNotFoundException after the first root cause.

I think the right thing to do may be to treat it as though the servlet is
attempting to set the status or a header and ignore it by changing line 249
of org.apache.tomcat.core.Handeler to be wraped in a try block catching a
IllegalStateException and silently dropping the excpetion.  We may need to
do this around line 253 as well.  This error occurs when the servlet is
including a non-existant servlet, but that presumes that it could be thrown
only when it is in a doublely nested mode.  Perhaps if there was some way to
divine the fact that the request is being handeled in an included servlet in
ContextManager it would be better not to call the resetBuffer methods in
handleStatus and handleError methods.  Is this catalina's behavior as well?

I would say it is almost a conformance issue because the behavior in 2.13.4
says that the resouce included by a jsp:include tag should only modify the
JspWriter.  The behavior of a RequestDispatcher.include of a bogus servlet
is to set it as a page not found, but if it were a servlet attempting to set
the header response to 404 it would be ignored.  Since it is the container
attempting to do the change it could be treated as the servlet attempting to
change it and hence ignored.

--Danno

----- Original Message -----
From: "Nick Bauman" <ni...@cortexity.com>
To: <to...@jakarta.apache.org>
Sent: Friday, September 15, 2000 2:19 PM
Subject: Re: BugRat Report #124 has been filed.


> Is this really a bug?
>
> On Fri, 15 Sep 2000, BugRat Mail System wrote:
>
> > Bug report #124 has just been filed.
> >
> > You can view the report at the following URL:
> >
> >    <http://znutar.cortexity.com:8888/BugRatViewer/ShowReport/124>
> >
> > REPORT #124 Details.
> >
> > Project: Tomcat
> > Category: Bug Report
> > SubCategory: New Bug Report
> > Class: swbug
> > State: received
> > Priority: medium
> > Severity: non-critical
> > Confidence: public
> > Environment:
> >    Release: Tomcat 3.2b4
> >    JVM Release: jdk1.2.2
> >    Operating System: linux
> >    OS Release: redhat 6.2
> >    Platform: x86
> >
> > Synopsis:
> > IllegalStateException when error in jsp servlet include encountered
> >
> > Description:
> > If a jsp page references a servlet after including some other content,
and gets a ClassNotFoundException on that servlet, an IllegalStateException
occurs during a buffer reset.
> > This error is very misleading, and doesn't point to the classpath or
servlet setup in web.xml as the cause. It looks like it's an internal error
in Tomcat
> > instead of a simple configuration error.
> >
> > Stacktraces:
> >
> > Location:/test/foobar.jsp
> >
> > Internal Servlet Error:
> >
> > javax.servlet.ServletException: can't reset buffer after writing to
client
> >         at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:448)
> >         at
_0002ffoobar_0002ejspfoobar_jsp_1._jspService(_0002ffoobar_0002ejspfoobar_js
p_1.java:75)
> >         at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:177)
> >         at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309)
> >         at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:382)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387)
> >         at org.apache.tomcat.core.Handler.service(Handler.java:263)
> >         at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
> >         at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:74
9)
> >         at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:695)
> >         at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:207)
> >         at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403)
> >         at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> >         at java.lang.Thread.run(Thread.java:475)
> >
> > Root cause:
> >
> > java.lang.IllegalStateException: can't reset buffer after writing to
client
> >         at
org.apache.tomcat.core.BufferedServletOutputStream.reset(BufferedServletOutp
utStream.java:296)
> >         at
org.apache.tomcat.core.ResponseImpl.resetBuffer(ResponseImpl.java:395)
> >         at
org.apache.tomcat.core.ContextManager.handleStatus(ContextManager.java:953)
> >         at org.apache.tomcat.core.Handler.service(Handler.java:249)
> >         at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
> >         at
org.apache.tomcat.facade.RequestDispatcherImpl.include(RequestDispatcherImpl
.java:308)
> >         at
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:407)
> >         at
_0002ffoobar_0002ejspfoobar_jsp_1._jspService(_0002ffoobar_0002ejspfoobar_js
p_1.java:65)
> >         at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:177)
> >         at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309)
> >         at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:382)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >         at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387)
> >         at org.apache.tomcat.core.Handler.service(Handler.java:263)
> >         at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
> >         at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:74
9)
> >         at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:695)
> >         at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:207)
> >         at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403)
> >         at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> >         at java.lang.Thread.run(Thread.java:475)
> >
>
> --
> Nicolaus Bauman
> Software Engineer
> Simplexity Systems
> I'll give you $5 if you follow this link:
> https://secure.paypal.x.com/refer/pal=nixnixnix%40yahoo.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>


Re: BugRat Report #124 has been filed.

Posted by Nick Bauman <ni...@cortexity.com>.
Is this really a bug?

On Fri, 15 Sep 2000, BugRat Mail System wrote:

> Bug report #124 has just been filed.
> 
> You can view the report at the following URL:
> 
>    <http://znutar.cortexity.com:8888/BugRatViewer/ShowReport/124>
> 
> REPORT #124 Details.
> 
> Project: Tomcat
> Category: Bug Report
> SubCategory: New Bug Report
> Class: swbug
> State: received
> Priority: medium
> Severity: non-critical
> Confidence: public
> Environment: 
>    Release: Tomcat 3.2b4
>    JVM Release: jdk1.2.2
>    Operating System: linux
>    OS Release: redhat 6.2
>    Platform: x86
> 
> Synopsis: 
> IllegalStateException when error in jsp servlet include encountered
> 
> Description:
> If a jsp page references a servlet after including some other content, and gets a ClassNotFoundException on that servlet, an IllegalStateException occurs during a buffer reset.
> This error is very misleading, and doesn't point to the classpath or servlet setup in web.xml as the cause. It looks like it's an internal error in Tomcat
> instead of a simple configuration error.
> 
> Stacktraces:
> 
> Location:/test/foobar.jsp
> 
> Internal Servlet Error:
> 
> javax.servlet.ServletException: can't reset buffer after writing to client
>         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:448)
>         at _0002ffoobar_0002ejspfoobar_jsp_1._jspService(_0002ffoobar_0002ejspfoobar_jsp_1.java:75)
>         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
>         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309)
>         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:382)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387)
>         at org.apache.tomcat.core.Handler.service(Handler.java:263)
>         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
>         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:749)
>         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:695)
>         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:207)
>         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403)
>         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
>         at java.lang.Thread.run(Thread.java:475)
> 
> Root cause: 
> 
> java.lang.IllegalStateException: can't reset buffer after writing to client
>         at org.apache.tomcat.core.BufferedServletOutputStream.reset(BufferedServletOutputStream.java:296)
>         at org.apache.tomcat.core.ResponseImpl.resetBuffer(ResponseImpl.java:395)
>         at org.apache.tomcat.core.ContextManager.handleStatus(ContextManager.java:953)
>         at org.apache.tomcat.core.Handler.service(Handler.java:249)
>         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
>         at org.apache.tomcat.facade.RequestDispatcherImpl.include(RequestDispatcherImpl.java:308)
>         at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:407)
>         at _0002ffoobar_0002ejspfoobar_jsp_1._jspService(_0002ffoobar_0002ejspfoobar_jsp_1.java:65)
>         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
>         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309)
>         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:382)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387)
>         at org.apache.tomcat.core.Handler.service(Handler.java:263)
>         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
>         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:749)
>         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:695)
>         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:207)
>         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403)
>         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
>         at java.lang.Thread.run(Thread.java:475)
> 

-- 
Nicolaus Bauman
Software Engineer
Simplexity Systems
I'll give you $5 if you follow this link:
https://secure.paypal.x.com/refer/pal=nixnixnix%40yahoo.com