Hi Bruno, Remove the flush(): your duty is to fill up the stream with the content to deliver . Later on, the servlet handler to which you give the response (incl the stream) back will flush it back to the browser.
regards didier On Nov 5, 8:01 pm, Bruno Santos <[email protected]> wrote: > I'm trying to generate a report using JaperReports, but when I click > generate the following error appears in eclipse: > > [WARN] /seringueira/resumosafra > java.lang.RuntimeException: Unable to report failure > at > com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doUnexpectedFailure(AbstractRemoteServiceServlet.java:107) > at > com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:67) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > at > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) > at > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362) > at > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) > at > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) > at > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729) > at > org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) > at > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) > at > org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49) > at > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) > at org.mortbay.jetty.Server.handle(Server.java:324) > at > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) > at > org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843) > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647) > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) > at > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) > at > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488) > Caused by: java.io.IOException: Closed > at > org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:627) > at > org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:587) > at > com.google.gwt.user.server.rpc.RPCServletUtils.writeResponse(RPCServletUtils.java:330) > at > com.google.gwt.user.server.rpc.RemoteServiceServlet.writeResponse(RemoteServiceServlet.java:352) > at > com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:251) > at > com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62) > ... 19 more > > In class Impl I use the following: > > if(bytes != null && bytes.length > 0) { > getThreadLocalResponse().setContentType("application/pdf"); > getThreadLocalResponse().setContentLength(bytes.length); > try { > ServletOutputStream ouputStream = > getThreadLocalResponse().getOutputStream(); > ouputStream.write(bytes, 0, bytes.length); > ouputStream.flush(); > ouputStream.close(); > } catch(Exception ex) { > ex.getMessage(); > } > > } > > Does anyone have any idea what I might be doing wrong? -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
