我们有一个Java EE应用程序,JRE 6,MySQL 5.5 ,在Tomcat 5.5上运行。我们有几个JR报告正常工作,但其中一个会导致以下 Tomcat 错误:
org.apache.jasper.JasperException: getOutputStream() ya ha sido llamado para esta respuesta
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:367)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
com.tsystems.web.common.FiltroSeguridad.doFilter(FiltroSeguridad.java:79)
Eclipse 的控制台:
Could not load object from location : ..\..\iReport\PDFInformeCuadroGestionSub1.jasper
net.sf.jasperreports.engine.JRException: Could not load object from location : ..\..\iReport\PDFInformeCuadroGestionSub1.jasper
at net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:271)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:311)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:260)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:275)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:426)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1380)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:692)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:255)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:113)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:888)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:810)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601)
at com.tsystems.web.ModuloInformes.InformesNuevos.InformeGestion.Actions.InformeGestionAction.generarReporte(InformeGestionAction.java:1573)
at com.tsystems.web.ModuloInformes.InformesNuevos.InformeGestion.Actions.InformeGestionAction.generarInformeGestion(InformeGestionAction.java:207)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.tsystems.web.common.FiltroSeguridad.doFilter(FiltroSeguridad.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
生成报告的方法是这样的(不完整,只有调用和其他一些东西):
private void generarReporte(List info,
InformeGestionFormBean gestionBean,
HttpServletRequest request,
HttpServletResponse response,
String descripDispo) {
try {
ServletOutputStream out = response.getOutputStream();
String centro = descripDispo;
String imagenlogo = ".." + File.separator + ".." + File.separator + "images" + File.separator + "logo2.jpg";
String imageninforme = ".." + File.separator + ".." + File.separator + "images" + File.separator + "finforme.jpg";
String imagenflecha = ".." + File.separator + ".." + File.separator + "images" + File.separator + "flecha.jpg";
String ruta = ".." + File.separator + ".." + File.separator + "iReport" + File.separator;
Map parametros = new HashMap();
parametros.put("TITULO", "INFORME CUADRO DE GESTION DE "+centro+"");
parametros.put("FECHA_ANYO", gestionBean.getAnioPeriodo());
parametros.put("CENTRO", centro);
parametros.put("IMAGEN_LOGO", imagenlogo);
parametros.put("IMAGEN_INFORME", imageninforme);
parametros.put("IMAGEN_FLECHA", imagenflecha);
parametros.put("SUBREPORT_DIR", ruta);
InputStream is = null;
String header = "";
is = InformeGestionAction.class.getClassLoader().getResourceAsStream(ruta + "InformeCuadroGestion.jrxml");
header = "attachment; filename=\"InformeCuadroGestion";
JRExporter exporter = null;
JasperReport reporte = JasperCompileManager.compileReport(is);
JRDataSource aux = new JRBeanCollectionDataSource(info);
JasperPrint jasperPrint = JasperFillManager.fillReport(reporte, parametros, aux);
这份报告几周前运行良好,但现在不行了。我从它工作正常时就尝试使用备份中的代码,但问题仍然存在。也许我改变了配置什么的,我不知道。