当我尝试通过批处理文件生成报告时,为什么无法生成报告?

时间:2012-12-21 09:57:12

标签: java batch-file jasper-reports

我面临一个非常奇怪的问题。当我从我的java类调用.jrxml文件时,一切正常。但是当我从批处理文件中调用相同的java类时,我无法生成报告。控制台显示如下错误。请帮帮我。

Stacktrace:

2012-12-21 16:15:13,466 net.sf.jasperreports.engine.fill.JRFillSubreport : prepare - Fill 31497899: exception java.lang.NullPointerException 
  at net.sf.jasperreports.engine.fill.JRFillImage.evaluateImage(JRFillImage.java:1034??)  
  at net.sf.jasperreports.engine.fill.JRFillImage.evaluate(JRFillImage.java:1004)
  at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementCo??ntainer.java:258)
  at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageHeader(JRVerticalFille??r.java:403) 
  at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFill??er.java:264) 
  at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.ja??va:128)  
net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:499) 
  at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillBandNoOverflow(JRVerticalF??iller.java:439) 
  at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:946) 
  at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:845) 
  at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.j??ava:609) 
  at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.jav??a:59) 
  at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRu??nner.java:205) 
  at java.lang.Thread.run(Thread.java:619)

1 个答案:

答案 0 :(得分:1)

我的猜测是它无法找到图像。尝试将绝对路径放到图像文件中,只是为了调试并查看会发生什么。我的猜测是,当你从命令行运行它时,它正在寻找错误位置的图像。