[MAGNOLIA-2623] RenderingFilter logs a "Unable to redirect to 404 page, response is already committed" any time there is an error while streaming back a resource Created: 15/Feb/09 Updated: 23/Jan/13 Resolved: 15/Feb/09 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | core |
| Affects Version/s: | 4.0 |
| Fix Version/s: | 4.0 |
| Type: | Bug | Priority: | Trivial |
| Reporter: | Fabrizio Giustina | Assignee: | Fabrizio Giustina |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Patch included: |
Yes
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
| Description |
|
This is really trivial, the problem is just a spurious log.info(). catch (IOException e) {
// don't log at error level since tomcat tipically throws a
// org.apache.catalina.connector.ClientAbortException if the user stops loading the page
log.debug("Exception while dispatching resource " + e.getClass().getName() + ": " + e.getMessage(), e); //$NON-NLS-1$ //$NON-NLS-2$
}
catch (Exception e) {
log.error("Exception while dispatching resource " + e.getClass().getName() + ": " + e.getMessage(), e); //$NON-NLS-1$ //$NON-NLS-2$
}
finally {
IOUtils.closeQuietly(is);
}
// missing return here
}
log.debug("Resource not found, redirecting request for [{}] to 404 URI", request.getRequestURI()); //$NON-NLS-1$
if (!response.isCommitted()) {
response.sendError(HttpServletResponse.SC_NOT_FOUND);
}
else {
log.info("Unable to redirect to 404 page, response is already committed"); //$NON-NLS-1$
}
|
| Comments |
| Comment by Fabrizio Giustina [ 15/Feb/09 ] |
|
fixed by adding a return statement in the catch blocks |