cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rice Yeh (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COCOON-2150) Error on resetting response
Date Wed, 12 Mar 2008 07:52:51 GMT

    [ https://issues.apache.org/jira/browse/COCOON-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577744#action_12577744
] 

Rice Yeh commented on COCOON-2150:
----------------------------------

I do not know whether I am naive to say just adding !wrappedResponse.isCommited()  on the
if statement on line 482 in ServletServiceContext.java may solve the problem. The following
is the patch.

Index: C:/coffee/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/ServletServiceContext.java
===================================================================
--- C:/coffee/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/ServletServiceContext.java
(revision 635788)
+++ C:/coffee/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/ServletServiceContext.java
(working copy)
@@ -479,7 +479,7 @@
                 }
 
                 int status = wrappedResponse.getStatus();
-                if (se != null || (status < 200 || status >= 400)) {
+                if (!wrappedResponse.isCommitted() && (se != null || (status <
200 || status >= 400))) {
                     wrappedResponse.reset();
                     NamedDispatcher _super = (NamedDispatcher) ServletServiceContext.this.getNamedDispatcher(SUPER);
                     if (_super != null) {


> Error on resetting response
> ---------------------------
>
>                 Key: COCOON-2150
>                 URL: https://issues.apache.org/jira/browse/COCOON-2150
>             Project: Cocoon
>          Issue Type: Bug
>          Components: - Servlet service framework
>    Affects Versions: 2.2-dev (Current SVN)
>            Reporter: Jörg Heinicke
>            Assignee: Grzegorz Kossakowski
>             Fix For: 2.2-dev (Current SVN)
>
>
> This is the exception shown on the console:
> java.lang.IllegalStateException: Committed
>         at org.mortbay.jetty.Response.resetBuffer(Response.java:855)
>         at org.mortbay.jetty.Response.reset(Response.java:834)
>         at javax.servlet.ServletResponseWrapper.reset(ServletResponseWrapper.java:182)
>         at org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:576)
>         at org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(ServletServiceContext.java:545)
>         at org.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterceptor.invoke(ServletFactoryBean.java:230)
>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
>         at $Proxy2.service(Unknown Source)
>         at org.apache.cocoon.servletservice.DispatcherServlet.service(DispatcherServlet.java:102)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>         at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
> It seems to be thrown whenever the response object is reseted after the actual response
has been sent by the sitemap error handler. In this case reset is no longer possible since
the response has already been committed as stated in the error message.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message