Java:应用程序在Eclipse上运行,但在导出后错过了jars

时间:2019-06-28 14:28:03

标签: java eclipse jasper-reports

我的swing应用程序在eclipse中运行得很好
但是当我将其导出到“可执行jar”时,尝试使用JasperReports打印某些内容时会出现此异常:

Exception in thread "Thread-6" java.lang.ExceptionInInitializerError
        at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:97)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:74)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:62)
        at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:187)
        at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:202)
        at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:110)
        at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:584)
        at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:930)
        at smt.agm.launcher.SmartPaieLauncher$2.run(SmartPaieLauncher.java:94)
        at java.lang.Thread.run(Unknown Source)
Caused by: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Input stream not found at : fonts.xml
        at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontFamilies(SimpleFontExtensionHelper.java:188)
        at net.sf.jasperreports.engine.fonts.FontExtensionsRegistry.getExtensions(FontExtensionsRegistry.java:56)
        at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getExtensions(DefaultExtensionsRegistry.java:110)
        at net.sf.jasperreports.engine.util.JRStyledTextParser.<clinit>(JRStyledTextParser.java:83)
        ... 10 more
Caused by: net.sf.jasperreports.engine.JRException: Input stream not found at : fonts.xml
        at net.sf.jasperreports.repo.RepositoryUtil.getInputStreamFromLocation(RepositoryUtil.java:159)
        at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontFamilies(SimpleFontExtensionHelper.java:183)

为什么会这样?

编辑
我在JasperReports内使用ProjectX,而这个ProjectX在使用另一个Java项目,我们称之为ProjectY
在两个项目中,我正在使用JasperReports jars
当我从JasperReports中删除ProjectY时,该异常不再存在。
这是什么解释?
以及如何在JasperReports中使用ProjectY

0 个答案:

没有答案