tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 22466] New: - StackOverflowError in ResponseBase.write (no recursion)
Date Fri, 15 Aug 2003 16:40:10 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22466>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22466

StackOverflowError in ResponseBase.write (no recursion)

           Summary: StackOverflowError in ResponseBase.write (no recursion)
           Product: Tomcat 4
           Version: 4.0.2 Final
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: mcepek@smsi.com


We have a JSP page that brings down JBoss with a StackOverflowError
exception when it iterates too many (2419) times.

We are using JBoss 2.4.4 and Struts 1.0.2 on SCO 5.0.6 with
Caldera-UNIX-J2SE-1.3.0_02 (green threads, sunwjit).

I am including the stack trace and JSP code below.  There is no
recursion, the stack has only 60 frames.  Also, our javac has no
-Xss (stack size) option.

When it crashes, the browser (not surprisingly) receives incomplete
HTML (approx 3 Mb).

One bit of explanation about the JSP:  we used a file called
GUIStyle.properties to contain common HTML snippets.  (And yes,
we are currently converting to CSS :-)

I would greatly appreciate any fix or workaround suggestions, pointers
to known bugs causing this, or recommendations for further debugging.

Thanks in advance.

P.S.  I just confirmed that JBoss running on Win2k does NOT exhibit this
problem.  However, since virtually all of the code in the stack trace is
JBoss', I don't think this can be easily dismissed as an OS or JVM problem.
I am working to reduce the JSP to something smaller and repeatable.

  -----------------------  Stack Trace:  -----------------------

2003-08-13 11:32:51,361 HttpProcessor[8080][4]/ERROR: ApplicationDispatcher
[/webconfig] Servlet.service() for servlet jsp threw exception
javax.servlet.ServletException
   at org.apache.jasper.runtime.PageContextImpl.handlePageException
(PageContextImpl.java:457)
   at org.apache.jsp.agentList$jsp._jspService(agentList$jsp.java, Compiled 
Code)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
(JspServlet.java, Compiled Code)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java, Compiled 
Code)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at org.apache.catalina.core.ApplicationDispatcher.invoke
(ApplicationDispatcher.java, Compiled Code)
   at org.apache.catalina.core.ApplicationDispatcher.doForward
(ApplicationDispatcher.java, Compiled Code)
   at org.apache.catalina.core.ApplicationDispatcher.forward
(ApplicationDispatcher.java:355)
   at org.apache.struts.action.RequestProcessor.doForward
(RequestProcessor.java:961)
   at org.apache.struts.action.RequestProcessor.processActionForward
(RequestProcessor.java:400)
   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java, 
Compiled Code)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1227)
   at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:484)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java, Compiled Code)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java, Compiled Code)
   at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java, Compiled Code)
   at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java, Compiled Code)
   at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, 
Compiled Code)
   at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java, Compiled Code)
   at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java, Compiled Code)
   at org.apache.catalina.valves.CertificatesValve.invoke
(CertificatesValve.java:246)
   at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java, Compiled Code)
   at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, 
Compiled Code)
   at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
   at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:164)
   at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java, Compiled Code)
   at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
   at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java, Compiled Code)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java, 
Compiled Code)
   at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java, Compiled Code)
   at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, 
Compiled Code)
   at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:163)
   at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java, Compiled Code)
   at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, 
Compiled Code)
   at org.apache.catalina.connector.http.HttpProcessor.process
(HttpProcessor.java, Compiled Code)
   at org.apache.catalina.connector.http.HttpProcessor.run
(HttpProcessor.java:1106)
   at java.lang.Thread.run(Thread.java:484)
2003-08-13 11:32:51,436 HttpProcessor[8080][4]/ERROR: ----- Root Cause -----
java.lang.StackOverflowError
   at org.apache.catalina.connector.ResponseBase.write(ResponseBase.java, 
Compiled Code)
   at org.apache.catalina.connector.ResponseStream.write(ResponseStream.java, 
Compiled Code)
   at org.apache.catalina.connector.http.HttpResponseStream.write
(HttpResponseStream.java, Compiled Code)
   at javax.servlet.ServletOutputStream.print(ServletOutputStream.java, 
Compiled Code)
   at javax.servlet.ServletOutputStream.println(ServletOutputStream.java, 
Compiled Code)
   at org.apache.catalina.connector.http.HttpResponseStream.write
(HttpResponseStream.java, Compiled Code)
   at java.io.OutputStreamWriter.write(OutputStreamWriter.java, Compiled Code)
   at java.io.PrintWriter.write(PrintWriter.java, Compiled Code)
   at org.apache.catalina.connector.ResponseWriter.write(ResponseWriter.java, 
Compiled Code)
   at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java, 
Compiled Code)
   at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java, 
Compiled Code)
   at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java, 
Compiled Code)
   at org.apache.jasper.runtime.JspWriterImpl.print(JspWriterImpl.java, 
Compiled Code)
   at org.apache.struts.util.ResponseUtils.writePrevious(ResponseUtils.java, 
Compiled Code)
   at org.apache.struts.taglib.logic.IterateTag.doAfterBody(IterateTag.java, 
Compiled Code)
   at org.apache.jsp.agentList$jsp._jspService(agentList$jsp.java, Compiled 
Code)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
(JspServlet.java, Compiled Code)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java, Compiled 
Code)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at org.apache.catalina.core.ApplicationDispatcher.invoke
(ApplicationDispatcher.java, Compiled Code)
   at org.apache.catalina.core.ApplicationDispatcher.doForward
(ApplicationDispatcher.java, Compiled Code)
   at org.apache.catalina.core.ApplicationDispatcher.forward
(ApplicationDispatcher.java:355)
   at org.apache.struts.action.RequestProcessor.doForward
(RequestProcessor.java:961)
   at org.apache.struts.action.RequestProcessor.processActionForward
(RequestProcessor.java:400)
   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java, 
Compiled Code)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1227)
   at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:484)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java, Compiled Code)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java, Compiled Code)
   at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java, Compiled Code)
   at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java, Compiled Code)
   at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, 
Compiled Code)
   at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java, Compiled Code)
   at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java, Compiled Code)
   at org.apache.catalina.valves.CertificatesValve.invoke
(CertificatesValve.java:246)
   at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java, Compiled Code)
   at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, 
Compiled Code)
   at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
   at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:164)
   at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java, Compiled Code)
   at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
   at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java, Compiled Code)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java, 
Compiled Code)
   at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java, Compiled Code)
   at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, 
Compiled Code)
   at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:163)
   at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java, Compiled Code)
   at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, 
Compiled Code)
   at org.apache.catalina.connector.http.HttpProcessor.process
(HttpProcessor.java, Compiled Code)
   at org.apache.catalina.connector.http.HttpProcessor.run
(HttpProcessor.java:1106)
   at java.lang.Thread.run(Thread.java:484)

----------------------  agentList.jsp:  ----------------------

<%@page contentType="text/html" 
import="com.smsi.config.action.*,org.apache.commons.beanutils.*" 
language="java"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/config.tld" prefix="config" %>

<jsp:useBean id="agentList_Items" scope="request" class="java.util.ArrayList"/>
<jsp:useBean id="agentListForm" scope="request" 
class="org.apache.struts.validator.DynaValidatorForm"/>

<config:checkLogon/>

<html:html locale="true">
<head>
  <html:base/>
  <%@ include file="javascript/messageBox.js" %>
</head>

<body <bean:message bundle="GUIStyle" key="body_bkg"/> >

<html:errors />

<bean:message bundle="GUIStyle" key="table_outer_start"/>
<tr>
  <bean:message bundle="GUIStyle" key="td_outer_header_start" arg0="2"/>
  <bean:message key="agentListForm.subtitle"/>
  <bean:message bundle="GUIStyle" key="td_outer_header_end"/>
</tr>
<tr>
  <td align="center" valign="top">
  <bean:message bundle="GUIStyle" key="table_column_start"/>
  <tr>
    <bean:message bundle="GUIStyle" key="td_inner_header_start" arg0="1"/>
    <a href="agentList.do?action=sort&field=switch_name">
      <bean:message key="agentListForm.switchName.header"/>
    </a>
    <bean:message bundle="GUIStyle" key="td_inner_header_end"/>

    <bean:message bundle="GUIStyle" key="td_inner_header_start" arg0="1"/>
    <a href="agentList.do?action=sort&field=agent_id">
      <bean:message key="agentListForm.agentId.header"/>
    </a>
    <bean:message bundle="GUIStyle" key="td_inner_header_end"/>

    <bean:message bundle="GUIStyle" key="td_inner_header_start" arg0="1"/>
    <a href="agentList.do?action=sort&field=sw_agent_sname">
      <bean:message key="agentListForm.shortName.header"/>
    </a>
    <bean:message bundle="GUIStyle" key="td_inner_header_end"/>

    <bean:message bundle="GUIStyle" key="td_inner_header_start" arg0="5"/>
    <bean:message key="actions.header"/>
    <bean:message bundle="GUIStyle" key="td_inner_header_end"/>
  </tr>
  <tr>
  <td>
  <logic:iterate id="agent" name="agentList_Items"
      type="com.smsi.config.model.MutableAgentModel">
    <tr>
    <bean:message bundle="GUIStyle" key="td_column_data_start"/>
    <bean:write name="agent" property="switch_name"/>
    <bean:message bundle="GUIStyle" key="td_column_data_end"/>

    <bean:message bundle="GUIStyle" key="td_column_data_start"/>
    <bean:write name="agent" property="agent_id"/>
    <bean:message bundle="GUIStyle" key="td_column_data_end"/>

    <bean:message bundle="GUIStyle" key="td_column_data_start"/>
    <bean:write name="agent" property="sw_agent_sname"/>
    <bean:message bundle="GUIStyle" key="td_column_data_end"/>

    <bean:message bundle="GUIStyle" key="td_column_data_start"/>
    <a id="<bean:write name="agent" property="sw_agent_sname"/>-edit" 
href="agentList.do?action=edit&agentDetail_agentID=<bean:write name="agent" 
property="agent_id"/>&agentDetail_switchID=<bean:write name="agent" 
property="switch_id"/>&agentDetail_personID=<bean:write name="agent" 
property="person_id"/>">
        <bean:message key="edit.action"/>
    </a>
    <bean:message bundle="GUIStyle" key="td_column_data_end"/>

    <bean:message bundle="GUIStyle" key="td_column_data_start"/>
    <a id="<bean:write name="agent" property="sw_agent_sname"/>-copy" 
href="agentList.do?action=copy&agentDetail_agentID=<bean:write name="agent" 
property="agent_id"/>&agentDetail_switchID=<bean:write name="agent" 
property="switch_id"/>&agentDetail_personID=<bean:write name="agent" 
property="person_id"/>">
        <bean:message key="copy.action"/>
    </a>
    <bean:message bundle="GUIStyle" key="td_column_data_end"/>

    <bean:message bundle="GUIStyle" key="td_column_data_start"/>
    <a id="<bean:write name="agent" property="sw_agent_sname"/>-del" 
href="agentList.do?action=delete&agentList_agentID=<bean:write name="agent" 
property="agent_id"/>&agentList_switchID=<bean:write name="agent" 
property="switch_id"/>&agentList_personID=<bean:write name="agent" 
property="person_id"/>" name="<bean:write name="agent" 
property="sw_agent_sname"/>"
        onmousedown='return popConfirmForAnchor( this.href, "<bean:message 
key="agentListForm.confirmDelete"/>" + this.name + "?" );'>
      <bean:message key="delete.action"/>
    </a>
    <!-- TODO: i18n the above line -->
    <bean:message bundle="GUIStyle" key="td_column_data_end"/>

    <bean:message bundle="GUIStyle" key="td_column_data_start"/>
      <logic:notEqual name="agent" property="agentHide" value='N'>
        <a id="<bean:write name="agent" property="sw_agent_sname"/>-hide" 
href="agentList.do?
action=hide&agentList_agentHide=N&agentList_agentID=<bean:write name="agent" 
property="agent_id"/>&agentList_switchID=<bean:write name="agent" 
property="switch_id"/>&agentList_personID=<bean:write name="agent" 
property="person_id"/>">
          <bean:message key="agentListForm.show.action"/>
        </a>
      </logic:notEqual>  
      <logic:equal name="agent" property="agentHide" value='N'>
        <a id="<bean:write name="agent" property="sw_agent_sname"/>-hide" 
href="agentList.do?
action=hide&agentList_agentHide=Y&agentList_agentID=<bean:write name="agent" 
property="agent_id"/>&agentList_switchID=<bean:write name="agent" 
property="switch_id"/>&agentList_personID=<bean:write name="agent" 
property="person_id"/>">
            <bean:message key="agentListForm.hide.action"/>
        </a>
      </logic:equal>  
    <bean:message bundle="GUIStyle" key="td_column_data_end"/>

    <bean:message bundle="GUIStyle" key="td_column_data_start"/>
        <a id="<bean:write name="agent" property="sw_agent_sname"/>-group" 
href="agentList.do?action=group&agentID=<bean:write name="agent" 
property="agent_id"/>&switchID=<bean:write name="agent" 
property="switch_id"/>&personID=<bean:write name="agent" 
property="person_id"/>&swAgentName=<bean:write name="agent" 
property="sw_agent_sname"/>">
            <bean:message key="agentListForm.group.action"/>
        </a>
    <bean:message bundle="GUIStyle" key="td_column_data_end"/>
    </tr>
  </logic:iterate>
  <bean:message bundle="GUIStyle" key="table_column_end"/>
</td>
</tr>
<bean:message bundle="GUIStyle" key="table_outer_end"/>

<bean:message bundle="GUIStyle" key="table_button_start"/>
<html:form method="post" action="/agentList">
<tr>
  <td align="center">
  <html:submit property="agentList_newButton">
    <bean:message key="agentListForm.newButton"/>
  </html:submit>
  </td>
  <td align="center">
      <html:submit property="agentList_hideButton">
            <bean:message key="agentListForm.hideButton"/>
      </html:submit>
  </td>
</tr>
<bean:message bundle="GUIStyle" key="table_button_end"/>

</html:form>
</body>
</html:html>

Mime
View raw message