Anonymous | Login | Signup for a new account | 12-17-2024 08:39 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0004964 | [Resin] | major | always | 02-27-12 13:53 | 06-15-12 15:41 | ||||
Reporter | mcamca | View Status | public | ||||||
Assigned To | ferg | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 4.0.25 | ||||||
Summary | 0004964: ClassCastException from PageContextImpl.popBody() after call to pushBody(Writer) | ||||||||
Description |
com.caucho.jsp.PageContextImpl implements 2 versions of the pushBody() method: BodyContent pushBody(); JspWriter pushBody(Writer writer); However, its implementation of JspContext.popBody() performs a cast that assumes the no-args version of pushBody() was called. If the second form of pushBody() was called, then popBody() will fail with an exception like this: java.lang.ClassCastException: com.caucho.jsp.StreamJspWriter cannot be cast to com.caucho.jsp.BodyContentImpl at com.caucho.jsp.PageContextImpl.popBody(PageContextImpl.java:683) [...] I have observed this behavior in Resin 3.1.9 and 4.0.25. The following code change made the problem go away for me, but I'm not sufficiently familiar with Resin's code base to know if it's the best, or even a good, solution. Index: modules/resin/src/com/caucho/jsp/PageContextImpl.java =================================================================== --- modules/resin/src/com/caucho/jsp/PageContextImpl.java (revision 5126) +++ modules/resin/src/com/caucho/jsp/PageContextImpl.java (working copy) @@ -673,8 +673,7 @@ */ public JspWriter popBody() { - BodyContentImpl bodyOut = (BodyContentImpl) _out; - _out = bodyOut.getEnclosingWriter(); + _out = ((AbstractJspWriter) _out).getEnclosingWriter(); try { _bodyResponseStream.flushBuffer(); Index: modules/resin/src/com/caucho/jsp/StreamJspWriter.java =================================================================== --- modules/resin/src/com/caucho/jsp/StreamJspWriter.java (revision 5126) +++ modules/resin/src/com/caucho/jsp/StreamJspWriter.java (working copy) @@ -41,8 +41,6 @@ private Writer _writer; private JspPrintWriter _printWriter; - - private JspWriter _parent; // the page context private PageContextImpl _pageContext; @@ -63,7 +61,7 @@ */ void init(JspWriter parent, Writer writer) { - _parent = parent; + setParent(parent); _writer = writer; _isClosed = false; } |
||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed. 26 unique queries executed. |