JumpServlet : java.lang.IllegalStateException: Cannot forward after response has been committed

631 views
Skip to first unread message

Dynamo Developer

unread,
Nov 1, 2010, 6:25:25 PM11/1/10
to atg_...@googlegroups.com
Hello,

I am working configuring the JumpServlet for my application. I have done all the required configuration and re-code URL in JSP. I am able to see the converted URLs in page. but when I am clicking on that link. I am getting bellow exception. Any help would be greatly helpful.

16:57:03,525 ERROR [[MappedJumpServlet]] Servlet.service() for servlet MappedJumpServlet threw exception
java.lang.IllegalStateException: Cannot forward after response has been committed
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:302)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
        at atg.servlet.DeferredDispatcher.forward(DeferredDispatcher.java:236)
        at atg.servlet.WrappingRequestDispatcher.forward(WrappingRequestDispatcher.java:68)
        at atg.repository.seo.JumpServlet.service(JumpServlet.java:345)
        at atg.repository.seo.MappedJumpServlet.service(MappedJumpServlet.java:125)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:595)


Here is the config in web.xml...........

  <servlet>
    <servlet-name>MappedJumpServlet</servlet-name>
    <servlet-class>
      atg.repository.seo.MappedJumpServlet
    </servlet-class>
    <init-param>
      <param-name>loggingDebug</param-name>
      <param-value>true</param-value>
    </init-param>
    <init-param>
      <param-name>jumpServlet</param-name>
      <param-value>
        ctx:dynamo:atg/dynamo/servlet/dafpipeline/JumpServlet
      </param-value>
    </init-param>
  </servlet>


Rest all I am using as suggested CRS.

Please let me know if any one has any clue why I am getting this error. Let me also know if I need you to provide any other information


Thanks,
Jagadeesh.


Nooruddin Shaik

unread,
Nov 2, 2010, 1:56:30 AM11/2/10
to atg_...@googlegroups.com
This servlet is already configured in CRS Storefront module. And I don't see any such errors.
May be this is related to your custom code.




--
You received this message because you are subscribed to the Google Groups "ATG_Tech" group.
To post to this group, send email to atg_...@googlegroups.com
To unsubscribe from this group, send email to atg_tech-u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/atg_tech?hl=en

kartheek desineedi

unread,
Nov 2, 2010, 4:36:28 AM11/2/10
to atg_...@googlegroups.com
Hi Jagadeesh,

You would generally get such an error when you try to use a forward or a sendRedirect based on some condition.

Like

if(somecondition){

sendRedirect or forward
}

Regards
Kartheek


--
You received this message because you are subscribed to the Google Groups "ATG_Tech" group.
To post to this group, send email to atg_...@googlegroups.com
To unsubscribe from this group, send email to atg_tech-u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/atg_tech?hl=en



--
Kartheek DVRK

Oleksandr Zalizniak

unread,
Nov 2, 2010, 5:47:24 AM11/2/10
to atg_...@googlegroups.com
You have problem because before "forward" with is called from "JumpServlet", there was some output which was flushed into response. It is impossible to forward of redirect, if some response was already sent to client. Maybe you have some filters or another servlets mapped to your url-pattern?

Raja Ramachandran

unread,
Nov 2, 2010, 11:41:41 AM11/2/10
to atg_...@googlegroups.com
Second that. 

There is a component in your servlet pipeline that is committing the response. The other thing that I noticed is you have loggingDebug turned on. Sometimes debug statements are not done properly. Turn it off and see if that helps. 

Jagadeesh Tangudu

unread,
Nov 2, 2010, 7:14:53 PM11/2/10
to atg_...@googlegroups.com
Thank you very much all of your quick response on my issue.

I have done a mistake in my xxxIndirectTemplate.properties file. I have used site context in front of forwardUrlTemplateFormat which was wrong. I have removed that and it worked perfect

forwardUrlTemplateFormat=/store/{item.template.url,encode=false}?categoryId\={item.id}

Thanks,
Jagadeesh.
Reply all
Reply to author
Forward
0 new messages