在 JasperServer 和 iReport 中查看报告时出错
我定制了JasperServer
。 我将 PostgreSQL
数据库与 JasperServer
一起使用。我已经导入了报告。但是,我无法在 JasperServer
以及 iReport
中查看这些报告。 当我像 xml 一样查看它时,它显示一个很长的数字。
如果有人使用 Postgres 数据库配置了 JasperServer,请帮助我解决此问题。
注意:当我使用 MySQL 数据库时没有问题
当我尝试执行报告时,它抛出以下异常。 加载报告模板时出错
消息:
net.sf.jasperreports.engine.JRException:org.xml.sax.SAXParseException:序言中不允许出现内容。
级别:
严重
堆栈跟踪:
org.xml.sax.SAXParseException: Content is not allowed in prolog.
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:245)
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:228)
net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:216)
com.jaspersoft.ireport.designer.JrxmlLoader.reloadJasperDesign(JrxmlLoader.java:87)
com.jaspersoft.ireport.designer.JrxmlVisualView.run(JrxmlVisualView.java:505)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Content is not allowed in prolog.
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414)
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1039)
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
org.apache.commons.digester.Digester.parse(Digester.java:1647)
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:241)
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:228)
net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:216)
com.jaspersoft.ireport.designer.JrxmlLoader.reloadJasperDesign(JrxmlLoader.java:87)
com.jaspersoft.ireport.designer.JrxmlVisualView.run(JrxmlVisualView.java:505)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
I have customized JasperServer
.
I am using PostgreSQL
database with JasperServer
. I have imported reports. However I am not able to view those reports in JasperServer
as well as iReport
.
When I view it like xml it shows a long number.
Please help me to resolve this issue if anyone have configured JasperServer with Postgres database.
Note: There is no issue when I use MySQL database
It throwing following exception when I try to execute the report.
Error loading the report template
Message:
net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException: Content is not allowed in prolog.
Level:
SEVERE
Stack Trace:
org.xml.sax.SAXParseException: Content is not allowed in prolog.
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:245)
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:228)
net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:216)
com.jaspersoft.ireport.designer.JrxmlLoader.reloadJasperDesign(JrxmlLoader.java:87)
com.jaspersoft.ireport.designer.JrxmlVisualView.run(JrxmlVisualView.java:505)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Content is not allowed in prolog.
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414)
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1039)
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
org.apache.commons.digester.Digester.parse(Digester.java:1647)
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:241)
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:228)
net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:216)
com.jaspersoft.ireport.designer.JrxmlLoader.reloadJasperDesign(JrxmlLoader.java:87)
com.jaspersoft.ireport.designer.JrxmlVisualView.run(JrxmlVisualView.java:505)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此错误消息始终是由起始元素中的无效 XML 内容引起的。例如,额外的小点“.”在 XML 元素的开头。
< 之前的任何字符? xml....将导致上述 org.xml.sax.SAXParseException: Content is not allowed in prolog 错误消息。参考。
This error message is always caused by the invalid XML content in the beginning element. For example, extra small dot “.” in the beginning of XML element.
Any characters before the < ? xml…. will cause above org.xml.sax.SAXParseException: Content is not allowed in prolog error message.Reference.