title: Issue with generating jasper report when the app was compiled in fat jar
body: <p>I've successfully added jasper reports to my java app, and added fonts via font extensions. When i run my app in intelij idea, everything works fine, the report generate with chosen fonts. But, when I compile everything into one unified (single, fat and etc.) jar file, deploy it to the Wildfly and try to generate the report, i get the following error:</p>
  
  <pre><code>2020-04-30 13:44:20,834 ERROR [net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper] (DefaultDispatcher-worker-1) Error loading font family: net.sf.jasperreports.engine.fonts.InvalidFontException: Error loading font "net/sf/jasperreports/fonts/icons/icons.ttf".
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontFace.loadFont(SimpleFontFace.java:206)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontFace.setTtf(SimpleFontFace.java:167)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontFace(SimpleFontExtensionHelper.java:390)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontFamily(SimpleFontExtensionHelper.java:311)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontExtensions(SimpleFontExtensionHelper.java:259)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontExtensions(SimpleFontExtensionHelper.java:230)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontExtensions(SimpleFontExtensionHelper.java:187)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.FontExtensionsRegistry.ensureFontExtensions(FontExtensionsRegistry.java:93)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.FontExtensionsRegistry.getExtensions(FontExtensionsRegistry.java:57)
      at deployment.develop.war//net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getExtensions(DefaultExtensionsRegistry.java:134)
      at deployment.develop.war//net.sf.jasperreports.engine.util.JRStyledTextParser.&lt;clinit&gt;(JRStyledTextParser.java:86)
      at deployment.develop.war//net.sf.jasperreports.engine.fill.JRBaseFiller.&lt;init&gt;(JRBaseFiller.java:116)
      at deployment.develop.war//net.sf.jasperreports.engine.fill.JRVerticalFiller.&lt;init&gt;(JRVerticalFiller.java:79)
      at deployment.develop.war//net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:251)
      at deployment.develop.war//net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:272)
      at deployment.develop.war//net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:156)
      at deployment.develop.war//net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:145)
      at deployment.develop.war//net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:758)
      at deployment.develop.war//net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:739)
      at deployment.develop.war//net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:1061)
      at deployment.develop.war//ru.myproject.testspring.services.reports.ReportProvider.generateReportInternal(ReportProvider.kt:27)
      at deployment.develop.war//ru.myproject.testspring.services.reports.ReportProvider.generateReportInternal(ReportProvider.kt:10)
      at deployment.develop.war//ru.myproject.testspring.services.reports.AbstractReportProvider$generateReport$1$1.invokeSuspend(AbstractReportProvider.kt:52)
      at deployment.develop.war//kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
      at deployment.develop.war//kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
      at deployment.develop.war//kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
      at deployment.develop.war//kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
      at deployment.develop.war//kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
      at deployment.develop.war//kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
  Caused by: java.io.IOException: Problem reading font data.
      at java.desktop/java.awt.Font.createFont0(Font.java:1177)
      at java.desktop/java.awt.Font.createFont(Font.java:1046)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontFace.loadFont(SimpleFontFace.java:198)
      ... 28 more
  2020-04-30 13:44:20,826 ERROR [net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper] (DefaultDispatcher-worker-1) Error loading font family: net.sf.jasperreports.engine.fonts.InvalidFontException: Error loading font "fonts/TimesFont/times.ttf".
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontFace.loadFont(SimpleFontFace.java:206)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontFace.setTtf(SimpleFontFace.java:167)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontFace(SimpleFontExtensionHelper.java:379)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontFamily(SimpleFontExtensionHelper.java:311)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontExtensions(SimpleFontExtensionHelper.java:259)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontExtensions(SimpleFontExtensionHelper.java:230)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontExtensions(SimpleFontExtensionHelper.java:187)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.FontExtensionsRegistry.ensureFontExtensions(FontExtensionsRegistry.java:93)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.FontExtensionsRegistry.getExtensions(FontExtensionsRegistry.java:57)
      at deployment.develop.war//net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getExtensions(DefaultExtensionsRegistry.java:134)
      at deployment.develop.war//net.sf.jasperreports.engine.util.JRStyledTextParser.&lt;clinit&gt;(JRStyledTextParser.java:86)
      at deployment.develop.war//net.sf.jasperreports.engine.fill.JRBaseFiller.&lt;init&gt;(JRBaseFiller.java:116)
      at deployment.develop.war//net.sf.jasperreports.engine.fill.JRVerticalFiller.&lt;init&gt;(JRVerticalFiller.java:79)
      at deployment.develop.war//net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:251)
      at deployment.develop.war//net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:272)
      at deployment.develop.war//net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:156)
      at deployment.develop.war//net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:145)
      at deployment.develop.war//net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:758)
      at deployment.develop.war//net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:739)
      at deployment.develop.war//net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:1061)
      at deployment.develop.war//ru.myproject.testspring.services.reports.ReportProvider.generateReportInternal(ReportProvider.kt:27)
      at deployment.develop.war//ru.myproject.testspring.services.reports.ReportProvider.generateReportInternal(ReportProvider.kt:10)
      at deployment.develop.war//ru.myproject.testspring.services.reports.AbstractReportProvider$generateReport$1$1.invokeSuspend(AbstractReportProvider.kt:52)
      at deployment.develop.war//kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
      at deployment.develop.war//kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
      at deployment.develop.war//kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
      at deployment.develop.war//kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
      at deployment.develop.war//kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
      at deployment.develop.war//kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
  Caused by: java.io.IOException: Problem reading font data.
      at java.desktop/java.awt.Font.createFont0(Font.java:1177)
      at java.desktop/java.awt.Font.createFont(Font.java:1046)
      at deployment.develop.war//net.sf.jasperreports.engine.fonts.SimpleFontFace.loadFont(SimpleFontFace.java:198)
      ... 28 more
  </code></pre>
  
  <p>There is my code of font-extension</p>
  
  <p><strong>jasperreports_extension.properties</strong></p>
  
  <pre><code>net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
  net.sf.jasperreports.extension.simple.font.families.ireportfamily1586778266566=fonts/fontsfamily1586778266566.xml
  </code></pre>
  
  <p><strong>fontsfamily1586778266566.xml:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;fontFamilies&gt;
      &lt;fontFamily name="TimesFont"&gt;
          &lt;normal&gt;&lt;![CDATA[fonts/TimesFont/times.ttf]]&gt;&lt;/normal&gt;
          &lt;bold&gt;&lt;![CDATA[fonts/TimesFont/timesbd.ttf]]&gt;&lt;/bold&gt;
          &lt;italic&gt;&lt;![CDATA[fonts/TimesFont/timesi.ttf]]&gt;&lt;/italic&gt;
          &lt;boldItalic&gt;&lt;![CDATA[fonts/TimesFont/timesbi.ttf]]&gt;&lt;/boldItalic&gt;
          &lt;pdfEncoding&gt;&lt;![CDATA[Cp1251]]&gt;&lt;/pdfEncoding&gt;
          &lt;pdfEmbedded&gt;&lt;![CDATA[true]]&gt;&lt;/pdfEmbedded&gt;
          &lt;exportFonts/&gt;
      &lt;/fontFamily&gt;
      &lt;fontSet name="ReportFontSet"&gt;
          &lt;family familyName="TimesFont" primary="true"/&gt;
      &lt;/fontSet&gt;
  &lt;/fontFamilies&gt;
  </code></pre>
  
  <p>I see my font-extension jar in lib folder of my .war file (WEB-INF\lib). </p>
  
  <p>My environment:</p>
  
  <pre><code>jasperreports:6.12.2
  Wildfly 19
  </code></pre>
  
  <p>P.S.
  And very strange, that i receive the follow error from the logs:</p>
  
  <pre><code>Error loading font family: net.sf.jasperreports.engine.fonts.InvalidFontException: Error loading font "net/sf/jasperreports/fonts/icons/icons.ttf"
  </code></pre>
  
  <p>because icon.ttf locates in jasper default fonts folder in jasperreports:6.12.2.jar</p>