• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

IllegalStateException: Cannot forward. Response already committed.

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

i am using WebSphere Application Server V6.

On a command button i am invoking a method whitch is returning a string.
based on navigation rule navigation takes place BUT
i am getting java.lang.IllegalStateException: Cannot forward. Response already committed.
even after this Exception the next page comes and the application is working.

the same code is working on Exadel Studio 4.0 with apache tomcat

Please tell me when and why this Exception occures and how can we overcome this.
 
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Post your code
 
Sachin Vrma
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ali,

i have also made a test app just to check wheather it working or not.
In this test App :

Page1.jsp
<HTML>
<HEAD>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM Software Development Platform">
<TITLE>Page1.jsp</TITLE>
</HEAD>
<f:view>
<BODY>
<h:form>
<P>page 1</P>
<h:commandButton value="go" action="#{pc_Page1.go}" ></h:commandButton>
</h:form>
</BODY>
</f:view>
</HTML>

Page2.jsp
just written page2 int this page.

In BackingBean
just a single fuction:
public String go()
{
return "page2";
}


In faces Config; the navigation rule is:
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>page2</from-outcome>
<to-view-id>Page2.jsp</to-view-id>
</navigation-case>
</navigation-rule>


I am using IBM's WebSphere Integration Developer(WID) v6.
Here i have used sun's implementation of JSF.
I just copied the jars to lib folder. Then i got a massage that a new version is added and need to download extra tag libs from sun's site.

i think i am missing any tag lib.
but in that case it should not work.
but even after getting the exception the next page comes.
[ January 22, 2007: Message edited by: Sachin Vrma ]
 
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try changing page2.jsp to

<HTML>
<HEAD>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM Software Development Platform">
<TITLE>Page2.jsp</TITLE>
</HEAD>
<f:view>
<body>
<P>page 2</P>
</h:form>
</body>
</f:view>
</HTML>
 
Sachin Vrma
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes the Page2.jsp is also a jsf and written in the same manner.
providing the stack here:
Please check it out....


[1/23/07 15:08:46:943 IST] 0000007f ServletWrappe E SRVE0068E: Could not invoke the service() method on servlet Faces Servlet. Exception thrown : java.lang.IllegalStateException: Cannot forward. Response already committed.
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:157)
at com.ibm.faces.context.MultipartExternalContextImpl.dispatch(MultipartExternalContextImpl.java:320)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:254)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java(Compiled Code))
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java(Compiled Code))
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))

[1/23/07 15:08:47:022 IST] 0000007f ServletWrappe E SRVE0014E: Uncaught service() exception root cause Faces Servlet: Cannot forward. Response already committed.
[1/23/07 15:08:47:147 IST] 0000007f LocalTranCoor E WLTC0017E: Resources rolled back due to setRollbackOnly() being called.
[1/23/07 15:08:47:194 IST] 0000007f WebApp E SRVE0026E: [Servlet Error]-[Faces Servlet]: java.lang.IllegalStateException: Cannot forward. Response already committed.
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:157)
at com.ibm.faces.context.MultipartExternalContextImpl.dispatch(MultipartExternalContextImpl.java:320)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:254)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java(Compiled Code))
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java(Compiled Code))
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))

[1/23/07 15:08:47:225 IST] 0000007f SRTServletRes W WARNING: Cannot set status. Response already committed.
[1/23/07 15:08:47:287 IST] 0000007f SRTServletRes W WARNING: Cannot set header. Response already committed.
[ January 23, 2007: Message edited by: Sachin Vrma ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic