tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Quintin Beukes" <quin...@last.za.net>
Subject Fwd: Vicious Bug in the JSP code?
Date Thu, 10 Jul 2008 14:26:26 GMT
Hey,

Here is another one. There is 2 more that I don't see now. The 2 in
the first e-mail are very common. Though I can't reproduce it on my
local server. To give an idea, the loadTemplate() method does nothing
more than call setAttribute("JMTemplate", this), and the do the
forward(req,resp).

replyBody loads up a few variable values into the JSPTemplate class.
Then the JSP access these variables through a custom tag library, to
the tune of <tmpl:value name="someMapKey"/>. Very basic.

java.lang.IllegalStateException: Cannot reset buffer after response
has been committed
        at org.apache.catalina.connector.Response.resetBuffer(Response.java:666)
        at org.apache.catalina.connector.ResponseFacade.resetBuffer(ResponseFacade.java:291)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:306)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
        at templates.JSPTemplate.loadTemplate(JSPTemplate.java:64)
        at web.Search.replyBody(Search.java:255)
        at web.Search.doGet(Search.java:73)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
        at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:887)
        at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:696)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2009)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)


---------- Forwarded message ----------
From: Quintin Beukes <quintin@last.za.net>
Date: Thu, Jul 10, 2008 at 4:23 PM
Subject: Vicious Bug in the JSP code?
To: Tomcat Developers List <dev@tomcat.apache.org>


Hey,

Can someone please advise me on this one. I am at a total loss as to
what is going on here.

Since we search engine's deployed our output to be a JSP page, random
pages are failing. I would literally refresh the page, and it works
every time, and then suddenly, WAM. Also, not the same error every
time. We are using a custom tag library, but it doesn't fail in here.
For isntance, the following exception is because "context" is null.
Can someone explain to me WHY context would be null?
java.lang.NullPointerException
       at org.apache.catalina.connector.Request.setAttribute(Request.java:1424)
       at org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:503)
       at templates.JSPTemplate.loadTemplate(JSPTemplate.java:63)
       at web.Search.replyBody(Search.java:255)
       at web.Search.doGet(Search.java:73)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
       at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:887)
       at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:696)
       at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2009)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
       at java.lang.Thread.run(Thread.java:619)


Also this. I know that I didn't request the output stream or writer
from the response object. I NEVER do. I only do a
requestDispacter().forward(req,resp) to the JSP apge.
java.lang.IllegalStateException: Cannot forward after response has
been committed
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:302)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
       at templates.JSPTemplate.loadTemplate(JSPTemplate.java:64)
       at web.Search.replyBody(Search.java:255)
       at web.Search.doGet(Search.java:73)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
       at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:887)
       at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:696)
       at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2009)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
       at java.lang.Thread.run(Thread.java:619)


--
Quintin Beukes



-- 
Quintin Beukes

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message