jasperguest Posted January 9, 2011 Share Posted January 9, 2011 Hello everyone I'm trying to export a pdf jasper report made with the lastest ireport verisoin using the following jsp code from "http://raajasoft.wordpress.com/2009/10/26/jasper-report-export-all-formats-passing-parameters-using-jsp-page/" but i get a blank pdf page with the following exception from tomcat log in localhostjava.io.StreamCorruptedException: invalid stream header: 3C3F786D at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:782) at java.io.ObjectInputStream.<init>(ObjectInputStream.java:279) at net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.<init>(ContextClassLoaderObjectInputStream.java:53) at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:96) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:243) at org.apache.jsp.direction_002dregionale.report1_jsp._jspService(report1_jsp.java:89) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:662)Jan 9, 2011 8:40:48 PM org.apache.catalina.core.StandardWrapperValve invokeSEVERE: Servlet.service() for servlet jsp threw exceptionjava.lang.IllegalStateException: getOutputStream() has already been called for this response at org.apache.catalina.connector.Response.getWriter(Response.java:611) at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:198) at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:125) at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:118) at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:188) at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:118) at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:77) at org.apache.jsp.direction_002dregionale.report1_jsp._jspService(report1_jsp.java:183) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:662) Thanks taking time to reply Link to comment Share on other sites More sharing options...
Teodor Danciu Posted January 10, 2011 Share Posted January 10, 2011 Hi, You don't seem to pass the right file to the fillReport method.The report filling process expects a compiled report template, which usually are stored in *.jasper files.Are you passing the JRXML file to this method? If so, you need to pre-compile the JRXMLs at application built-time, maybe using an Ant taks, just like we do in our samples. iReport saves in this *.jasper format as well. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
jasperguest Posted January 10, 2011 Author Share Posted January 10, 2011 teodordWrote: Hi, You don't seem to pass the right file to the fillReport method. The report filling process expects a compiled report template, which usually are stored in *.jasper files. Are you passing the JRXML file to this method? If so, you need to pre-compile the JRXMLs at application built-time, maybe using an Ant taks, just like we do in our samples. iReport saves in this *.jasper format as well. I hope this helps. Teodor hellothanks for replyingthe .jsp file (below) takes as " GET" parameters the filename compiled and the reporttype (pdf, html,...) plus a parameter defined in the report.no I'm passing a compiled .jasper report, I'm getting a :"java.lang.IllegalStateException: getOutputStream() has already been called for this response"which seems related to the I/O process of generating the pdf file Code: Post Edited by jasperguest at 01/10/2011 19:43 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now