BIRT查看器 - IOException:prolog中不允许使用内容

时间:2011-11-30 23:42:56

标签: birt

我将下面的堆栈跟踪打印到我的日志/控制台。我正在使用Tomcat 6.0和BIRT 2.6.2。它不会阻止观看者显示报告,但它占用了日志中的宝贵空间。

我发现某人有类似的问题here,但没有明确指出解决方案是什么。就像该链接中的海报一样,我正在升级到新版本的BIRT(2.6.2)。

如果您需要有关我的设置的更多信息,请与我们联系。我对BIRT很新。 欢迎任何帮助,即使您可以建议一个可以看的地方。

java.io.IOException: Content is not allowed in prolog.
    at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
    at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
    at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown Source)
    at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown Source)
    at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source)
    at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)
    at org.eclipse.birt.report.engine.util.SvgFile.transSvgToArray(SvgFile.java:78)
    at org.eclipse.birt.report.engine.util.SvgFile.transSvgToArray(SvgFile.java:58)
    at org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitter.handleStyleImage(HTMLReportEmitter.java:3423)
    at org.eclipse.birt.report.engine.emitter.html.AttributeBuilder.buildBackground(AttributeBuilder.java:114)
    at org.eclipse.birt.report.engine.emitter.html.HTMLVisionOptimize.buildStyle(HTMLVisionOptimize.java:106)
    at org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitter.outputCSSStyles(HTMLReportEmitter.java:906)
    at org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitter.start(HTMLReportEmitter.java:722)
    at org.eclipse.birt.report.engine.emitter.CompositeContentEmitter.start(CompositeContentEmitter.java:225)
    at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:179)
    at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
    at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(ReportEngineService.java:928)
    at org.eclipse.birt.report.service.BirtViewerReportService.runAndRenderReport(BirtViewerReportService.java:973)
    at org.eclipse.birt.report.service.actionhandler.BirtRunAndRenderActionHandler.__execute(BirtRunAndRenderActionHandler.java:76)
    at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
    at org.eclipse.birt.report.presentation.aggregation.layout.EngineFragment.doService(EngineFragment.java:318)
    at org.eclipse.birt.report.presentation.aggregation.AbstractBaseFragment.service(AbstractBaseFragment.java:76)
    at org.eclipse.birt.report.servlet.BirtEngineServlet.__doGet(BirtEngineServlet.java:120)
    at org.eclipse.birt.report.servlet.BaseReportEngineServlet.doGet(BaseReportEngineServlet.java:185)
    at org.eclipse.birt.report.servlet.BaseReportEngineServlet.doPost(BaseReportEngineServlet.java:224)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.eclipse.birt.report.servlet.BaseReportEngineServlet.service(BaseReportEngineServlet.java:116)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    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.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:722)

1 个答案:

答案 0 :(得分:1)

这是以报表设计风格输入背景图像属性。

在CSS中,backgroundImage属性需要url('path/to/image.jpg')

body {
    background-image:url('path/to/image.jpg');
}

然而,BIRT似乎为样式呈现以下内容:

body {
    background-image:'path/to/image.jpg';
}

为了解决这个问题,我在初始化脚本中为每个使用backgroundImage样式的报表设计输入了以下内容:

reportContext.getDesignHandle().findStyle("blueresultsetheaderrow").backgroundImage = "url('images/BlueSortTitleBar.gif')";

我怀疑这是一个错误,所以我记录了this one