日期:2014-05-18  浏览次数:20783 次

恳求大侠们进来看看!!!
iReport在jsp中应用时报如下错误:
求大侠们帮我看看,有没有遇到过这样的问题,谢谢了!!1
严重:   Servlet.service()   for   servlet   jsp   threw   exception
net.sf.jasperreports.engine.JRException:   Error   loading   object   from   file   :   D:\report\iRoot\reportdepository\classic_serv.jrxml
at   net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:92)
at   net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:232)
at   net.sf.jasperreports.engine.JasperRunManager.runReportToPdf(JasperRunManager.java:203)
at   org.apache.jsp.beantestdemo3_jsp._jspService(beantestdemo3_jsp.java:73)
at   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at   org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:833)
at   org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:639)
at   org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1285)
at   java.lang.Thread.run(Thread.java:595)
Caused   by:   java.io.StreamCorruptedException:   invalid   stream   header
at   java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:753)
at   java.io.ObjectInputStream. <init> (ObjectInputStream.java:268)
at   net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:87)
...   21   more


------解决方案--------------------
没源代码怎么看呀?
------解决方案--------------------
D:\report\iRoot\reportdepository\classic_serv.jrxml
中有没有项目中没有的项
------解决方案--------------------
//报表编译之后生成的.jasper 文件的存放位置
File reportFile = new File(application.getRealPath( "\\reportdepository\\classic_serv.jrxml "));
应该是这个语句有问题,换成File reportFile = new File( "D:\\report\\iRoot\\reportdepository\\classic_serv.jrxml "
);
试一下
------解决方案--------------------
File reportFile = new File(application.getRealPath( "\\reportdepository\\classic_serv.jrxml ")); 
File reportFile = new File(application.getRealPath( "这里面应该写.jasper的文件&qu