Input stream not found at : fonts.xml

I've allready two days tring to resolve this issue and no success.This exception is thrown 

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.SimpleFontExtensionHelper.loadFontFamilies(SimpleFontExtensionHelper.java:188)

I use java 8 with Maven builder

It's my pom.xml configuration

<dependency>
    <groupId>net.sf.jasperreports</groupId>
    <artifactId>jasperreports</artifactId>
    <version>6.0.0</version>
</dependency>
<dependency>
    <groupId>net.sf.jasperreports</groupId>
    <artifactId>jasperreports-fonts</artifactId>
    <version>6.0.0</version>
</dependency>

This is a jasperreports_extension.properties configuration which is after packaging with maven located in root path

<div>net.sf.jasperreports.extension.registry.factory.system.font.families=net.sf.dynamicreports.jasper.base.JasperSystemFontExtensionsRegistryFactory</div><div>net.sf.jasperreports.extension.system.font.families.drfonts=fonts.xml</div>

This is my fonts.xml

<div>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</div><div><br></div><div>&lt;fontFamilies&gt;</div><div><br></div><div><span style="white-space:pre"> </span>&lt;fontFamily name="SansSerif"&gt;</div><div><span style="white-space:pre">  </span>&lt;exportFonts&gt;</div><div><span style="white-space:pre">   </span>&lt;export key="net.sf.jasperreports.html"&gt;Arial, Helvetica, sans-serif&lt;/export&gt;</div><div><span style="white-space:pre">   </span>&lt;export key="net.sf.jasperreports.xhtml"&gt;Arial, Helvetica, sans-serif&lt;/export&gt;</div><div><span style="white-space:pre">  </span>&lt;/exportFonts&gt;</div><div><span style="white-space:pre"> </span>&lt;/fontFamily&gt;</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>&lt;fontFamily name="Serif"&gt;</div><div><span style="white-space:pre">  </span>&lt;exportFonts&gt;</div><div><span style="white-space:pre">   </span>&lt;export key="net.sf.jasperreports.html"&gt;'Times New Roman', Times, serif&lt;/export&gt;</div><div><span style="white-space:pre">   </span>&lt;export key="net.sf.jasperreports.xhtml"&gt;'Times New Roman', Times, serif&lt;/export&gt;</div><div><span style="white-space:pre">  </span>&lt;/exportFonts&gt;</div><div><span style="white-space:pre"> </span>&lt;/fontFamily&gt;</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>&lt;fontFamily name="Monospaced"&gt;</div><div><span style="white-space:pre">  </span>&lt;exportFonts&gt;</div><div><span style="white-space:pre">   </span>&lt;export key="net.sf.jasperreports.html"&gt;'Courier New', Courier, monospace&lt;/export&gt;</div><div><span style="white-space:pre">   </span>&lt;export key="net.sf.jasperreports.xhtml"&gt;'Courier New', Courier, monospace&lt;/export&gt;</div><div><span style="white-space:pre">  </span>&lt;/exportFonts&gt;</div><div><span style="white-space:pre"> </span>&lt;/fontFamily&gt;</div><div><br></div><div>&lt;/fontFamilies&gt;</div>

When i do this in eclipse everthing works fine and PDF is created.

When i build via maven and try to execute from cmd then i got this exception.

I also tried to add another customfont.xml in net.sf.jasperreports.fonts and repath net.sf.jasperreports.extension.system.font.families.drfonts=fonts.xml to

net.sf.jasperreports.extension.system.font.families.drfonts=net/sf/jasperreports/fonts but nothing works....

i don't know what to do.

Anyone can help me please?

samuel.davidov's picture
Joined: Aug 9 2017 - 1:28pm
Last seen: 1 year 2 weeks ago

0 Answers:

No answers yet
Feedback
randomness