This typically happens when there’s an exception or something that would cause
the server to return an error code - but it cannot because it has already sent
the 200 OK line. Sometimes it masks an exception; try putting a try-catch
around your output.write() and log the exception to see what’s going on.
/Janne
On 24 May 2014, at 09:51 , Heather and Jon Turgeon
<tashiba40_evergr...@hotmail.com> wrote:
> Hi all, I am running into an issue with this bit of code
>
> return new StreamingResolution("application/octet-stream") {
> protected void stream(HttpServletResponse resp) throws Exception {
> OutputStream output = resp.getOutputStream();
> output.write(kap);
> }
> }.setFilename(fileName);
>
> "kap" is a kind of nautical chart that has 2 parts. The first part is a text
> header which describes the image which is the second part. To signify the end
> of the first text portion you need to write out a ascii char 26 then ascii
> char 0. These chars seem to be causing this issue
>
> java.lang.IllegalStateException: Cannot forward after response has been
> committed
> at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:349)
> at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
> at
> com.venturefarther.exception.VFExceptionHandler.handle(VFExceptionHandler.java:22)
> at
> net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:263)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> at
> org.apache.catalina.filters.ExpiresFilter.doFilter(ExpiresFilter.java:1179)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
> at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
> at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
> at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
> at
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:744)
>
> if I remove these 2 chars all is ok. Any thoughts?
>
> Jon
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs_______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users