0

I am using JasperReports and I am hitting an exception when I am trying to generate an html page hosted by my tomcat server.

The line:

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

ends up with the exception:

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

I believe it has something to do with server paths...

Thanks in advance.

Alex K
  • 22,315
  • 19
  • 108
  • 236
Chandrew
  • 16,987
  • 4
  • 24
  • 40
  • Also, I have added the xerces.jar into my project (http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=46889) – Chandrew Jun 29 '11 at 19:59
  • Also wanted to mention, I had a JasperReports project set up without a tomcat server, but it seems that once I moved the code + jar's over to my project with tomcat, it throws the exception. – Chandrew Jun 29 '11 at 21:10
  • 1
    Update: The xerces.jar fixed the exception. I guess my eclipse was out of sync for a little bit and I began searching for different xerces jars. – Chandrew Jun 29 '11 at 21:23
  • It seems that you have 2 different SAX Parsers on your path, xerces and gnujaxp (Aelfred). For details on which parser will be used, see http://stackoverflow.com/questions/1798366/how-do-i-find-out-which-jaxp-implementation-is-in-use-and-where-it-was-loaded-fr. In my experience, Aelfred does not always support all features, so I recommend you remove the gnujaxp.jar file from your project. – stefan.m Dec 07 '15 at 11:02

1 Answers1

0

you have add a duplicate xml api (.jar) ,

remove all xml regarding jars.

i had that problem, i just remove all jars then added only neccessory jars..