java - 无法运行 Jasper 报告 : The system cannot find the file specified

标签 java netbeans jasper-reports

我的报告位于 reports\templates\Contractor_Bill.jrxml 中,结果位于 reports\results\ 中。它在 Netbeans 6.5 中工作正常,但是当我将包含 exec jar 文件的 dist 文件夹复制到新位置并运行该 jar 时,它会抛出此异常。

我还在新位置创建了报告文件夹,但它仍然生成相同的异常。

Aug 5, 2009 10:11:58 PM cbs.ui.ReportUI GenerateReport
SEVERE: null
net.sf.jasperreports.engine.JRException: Error compiling report java source files : C:\Documents and Settings\Mohanish Timble\Desktop\sw\Contractor_Bill_old_1249490518017_973633.java
        at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:93)
        at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileUnits(JRAbstractClassCompiler.java:67)
        at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:190)
        at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:220)
        at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:153)
        at cbs.ui.ReportUI.GenerateReport(ReportUI.java:202)
        at cbs.ui.ReportUI.btnGenerateBillActionPerformed(ReportUI.java:151)
        at cbs.ui.ReportUI.access$100(ReportUI.java:38)
        at cbs.ui.ReportUI$2.actionPerformed(ReportUI.java:85)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.io.IOException: Cannot run program "javac": CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessBuilder.start(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:62)
        ... 33 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(Unknown Source)
        at java.lang.ProcessImpl.start(Unknown Source)
        ... 37 more
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java: 138)
        at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:57)
        at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402)
        at cbs.ui.ReportUI.GenerateReport(ReportUI.java:218)
        at cbs.ui.ReportUI.btnGenerateBillActionPerformed(ReportUI.java:151)
        at cbs.ui.ReportUI.access$100(ReportUI.java:38)
        at cbs.ui.ReportUI$2.actionPerformed(ReportUI.java:85)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)

最佳答案

将 Jar jasper-compiler-jdt 包含在 lib 文件夹中

关于java - 无法运行 Jasper 报告 : The system cannot find the file specified,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57726732/

相关文章:

java - 使用 Google 电子表格 API 卡住行并设置样式

java - 这个fxml错误代码在JavaFx中意味着什么

java - 如何在 Jython 中创建符号链接(symbolic link)

java - 我的 VisualVM 仅显示 Glassfish 和 Netbeans,而不是我在 Netbeans 中打开的一些项目

jasper-reports - 如何防止 JasperReports 中详细信息带之间的页面拆分

java - 如何将 selenium IDE 中记录的命令转换为 Java?

php - 刷新后维护动态下拉列表中的选择值

java - 使用 Spring 3.0.5 将 Jasper Reports 导出为 XLSX 格式

jasper-reports - iReport 问题与 isStretchWithOverflow

java - 找不到 java.net 的符号