创建SAX解析器时出错

时间:2011-06-29 19:33:16

标签: java tomcat jasper-reports

我正在使用JasperReports,当我尝试生成由我的tomcat服务器托管的html页面时,我遇到了异常。

该行:

JasperReport jasperReport = JasperCompileManager.compileReport(
"C:/Documents and Settings/axc1888/workspace/OATS/WebContent/status.jrxml");

以异常结束:

net.sf.jasperreports.engine.JRRuntimeException: Error creating SAX parser
  at net.sf.jasperreports.engine.xml.JRReportSaxParserFactory.createParser(JRReportSaxParserFactory.java:108)
  at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createParser(JRXmlDigesterFactory.java:1338)
  at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createDigester(JRXmlDigesterFactory.java:1313)
  at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:205)
  at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:170)
  at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:154)
  at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:146)
  ...

Caused by: org.xml.sax.SAXNotRecognizedException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
  at gnu.xml.aelfred2.XmlReader.getProperty(XmlReader.java:181)
  at gnu.xml.aelfred2.XmlReader.setProperty(XmlReader.java:166)
  at gnu.xml.aelfred2.JAXPFactory$JaxpParser.setProperty(JAXPFactory.java:147)
  at net.sf.jasperreports.engine.xml.JRReportSaxParserFactory.configureParser(JRReportSaxParserFactory.java:139)
  at net.sf.jasperreports.engine.xml.JRReportSaxParserFactory.createParser(JRReportSaxParserFactory.java:103)
  ... 8 more

我认为它与服务器路径有关...

提前致谢。

1 个答案:

答案 0 :(得分:0)

你添加了一个重复的xml api(.jar),

删除所有关于jar的xml。

我有这个问题,我只是删除所有的罐子,然后只添加了neccessory jar ..