打印例外

时间:2012-12-24 06:11:06

标签: java exception jasper-reports

我正在使用 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)

我该如何解决这个问题?

2 个答案:

答案 0 :(得分:1)

您的应用程序未找到所需的库。根据我的看法,您需要下载Apache's Crimson XML Parser并将其添加到应用程序的类路径中。

答案 1 :(得分:0)

看起来这个库不在你的类路径上

如果您在命令行上运行

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

  2. 手动在行中使用'-cp'添加更多同学条目。例如java -co jar1.jar; jar2.jar -jar my.jar这假设Windows是分隔符;