0

我正在使用Java开发软件。

我将JasperReports与用于账单打印的条码访问链接。

我的问题是,当我尝试打印该报告时,发生了此异常:

net.sf.jasperreports.engine.JRRuntimeException: java.io.IOException: SAX2 driver class org.apache.crimson.parser.XMLReaderImpl not found
    at net.sf.jasperreports.renderers.BatikRenderer.ensureSvg(BatikRenderer.java:198)
    at net.sf.jasperreports.renderers.BatikRenderer.getDimension(BatikRenderer.java:142)
    at net.sf.jasperreports.engine.export.draw.ImageDrawer.draw(ImageDrawer.java:110)
    at net.sf.jasperreports.engine.export.draw.PrintDrawVisitor.visit(PrintDrawVisitor.java:117)
    at net.sf.jasperreports.engine.export.draw.PrintDrawVisitor.visit(PrintDrawVisitor.java:55)
    at net.sf.jasperreports.engine.fill.JRTemplatePrintImage.accept(JRTemplatePrintImage.java:393)
    at net.sf.jasperreports.engine.export.draw.FrameDrawer.draw(FrameDrawer.java:231)
    at net.sf.jasperreports.engine.export.draw.FrameDrawer.draw(FrameDrawer.java:179)
    at net.sf.jasperreports.engine.export.JRGraphics2DExporter.exportPage(JRGraphics2DExporter.java:259)
    at net.sf.jasperreports.engine.export.JRGraphics2DExporter.exportReportToGraphics2D(JRGraphics2DExporter.java:232)
    at net.sf.jasperreports.engine.export.JRGraphics2DExporter.exportReport(JRGraphics2DExporter.java:171)
    at net.sf.jasperreports.engine.export.JRPrintServiceExporter.print(JRPrintServiceExporter.java:325)
    at sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:1968)
    at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1457)
    at net.sf.jasperreports.engine.export.JRPrintServiceExporter.exportReport(JRPrintServiceExporter.java:286)
    at Server.Print.Url.Print.printReport(Print.java:62)
    at Server.Print.Url.Print.createReports(Print.java:116)

我怎么解决这个问题?

4

2 回答 2

2

您的应用程序没有找到所需的库。据我所知,您需要下载Apache 的 Crimson XML Parser并将其添加到应用程序的类路径中。

于 2012-12-24T12:16:14.747 回答
0

看起来该库不在您的类路径中

如果您在命令行上运行

  1. 更新清单以将 jar 包含在其类路径中

  2. 在您的行中手动包含使用“-cp”以添加更多同学条目。例如 java -co jar1.jar;jar2.jar -jar my.jar 这假定 Windows 作为分隔符是 ;

于 2012-12-24T12:54:22.607 回答