JasperReport Exception: FontExtensionsRegistry.ensureFontExtensions: Loading font extensions from fonts.xml












0















I just finished a project, but when i put it in the production environment the JasperReport presents error on font.xml. I try run the project on my machine on terminal (linux) and the same error apears, work only if i run on Netebeans. For why work on Netbeans and on terminal no?



My project is simple, i generate on PDF and send it by e-mail. The structure is:



enter image description here



jasperreports_extension.properties:



net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
net.sf.jasperreports.extension.simple.font.families.arial=fonts.xml


fonts.xml:






<fontFamily name="Arial">
<normal>fonts/Arial.ttf</normal>
<bold>fonts/Arial Bold.ttf</bold>
<italic>fonts/Arial Italic.ttf</italic>
<boldItalic>fonts/Arial Bold Italic.ttf</boldItalic>
<pdfEncoding>Identity-H</pdfEncoding>
<pdfEmbedded>true</pdfEmbedded>
<exportFonts>
<export key="net.sf.jasperreports.html">Arial, Helvetica, sans-serif</export>
<export key="net.sf.jasperreports.xhtml">Arial, Helvetica, sans-serif</export>
</exportFonts>
</fontFamily>




POM:



<dependencies>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.5.0</version>
<exclusions>
<exclusion>
<groupId>jfree</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>bouncycastle</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>eclipse</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.castor</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports-fonts</artifactId>
<version>6.0.0</version>
</dependency>

<dependency>
<groupId>net.sourceforge.barbecue</groupId>
<artifactId>barbecue</artifactId>
<version>1.5-beta1</version>
</dependency>

<dependency>
<groupId>pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>0.7.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>

<build>

<pluginManagement>
<plugins>
<plugin>
<groupId>net.sourceforge.maven-taglib</groupId>
<artifactId>maven-taglib-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<goals>
<goal>taglibdocjar</goal>
</goals>
</execution>
</executions>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<versionRange>[1.0-beta-2,)</versionRange>
<goals>
<goal>compile-reports</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>net.sourceforge.maven-taglib</groupId>
<artifactId>maven-taglib-plugin</artifactId>
<version>2.4</version>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<version>1.0-beta-2</version>
<configuration>
<sourceDirectory>src/main/resources</sourceDirectory>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<compiler>net.sf.jasperreports.engine.design.JRJdtCompiler</compiler>
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.5.0</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api</artifactId>
<version>3.0.20100224</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile-reports</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>




The error:



19/11/18 00:00:00 DEBUG BaseReportFiller.<init>:149 - Fill 1: created for boleto-default
19/11/18 00:00:01 DEBUG BaseReportFiller.<init>:177 - created delayed actions 1 for filler 1
19/11/18 00:00:01 DEBUG ExtensionsEnvironment.createDefaultRegistry:87 - Instantiating extensions registry class net.sf.jasperreports.extensions.DefaultExtensionsRegistry
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.getRegistries:150 - Loading registries for cache key sun.misc.Launcher$AppClassLoader@70dea4e
19/11/18 00:00:01 DEBUG JRLoader.collectResources:791 - Found resource jasperreports_extension.properties at jar:file:/home/matheus/Downloads/myProject-1.0.0.jar!/jasperreports_extension.properties in classloader sun.misc.Launcher$AppClassLoader@70dea4e
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.loadRegistries:182 - Loading JasperReports extension properties resource jar:file:/home/matheus/Downloads/myProject-1.0.0.jar!/jasperreports_extension.properties
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.loadRegistries:264 - Instantiating registry of type net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.fonts
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.instantiateRegistry:289 - Instantiating extensions registry for fonts using factory class net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
19/11/18 00:00:01 DEBUG FontExtensionsRegistry.ensureFontExtensions:88 - Loading font extensions from fonts.xml
Exception in thread "TestThread" java.lang.ExceptionInInitializerError
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:111)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:69)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:57)
at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:219)
at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:234)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:134)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:667)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:648)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:970)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraRelatorio(GeradorDeBoleto.java:119)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraPDF(GeradorDeBoleto.java:160)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraPDF(GeradorDeBoleto.java:210)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraPDFStream(GeradorDeBoleto.java:229)
at br.com.company.test.TestThread.run(TestThread.java:57)
at java.lang.Thread.run(Thread.java:748)









share|improve this question























  • You have some more stacktrace for it?, is there another "Caused by"?

    – Petter Friberg
    Nov 21 '18 at 15:41











  • No. Only this show to me

    – Matheus Oliveira
    Nov 21 '18 at 15:58






  • 1





    Maybe problem with font.xml but I would not be 100÷ sure its actually the xml, that type error you get can get from problem loading a font (in stream) problem parsing jrxml (xerces hell) we would need some more info about the actual error

    – Petter Friberg
    Nov 21 '18 at 16:03
















0















I just finished a project, but when i put it in the production environment the JasperReport presents error on font.xml. I try run the project on my machine on terminal (linux) and the same error apears, work only if i run on Netebeans. For why work on Netbeans and on terminal no?



My project is simple, i generate on PDF and send it by e-mail. The structure is:



enter image description here



jasperreports_extension.properties:



net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
net.sf.jasperreports.extension.simple.font.families.arial=fonts.xml


fonts.xml:






<fontFamily name="Arial">
<normal>fonts/Arial.ttf</normal>
<bold>fonts/Arial Bold.ttf</bold>
<italic>fonts/Arial Italic.ttf</italic>
<boldItalic>fonts/Arial Bold Italic.ttf</boldItalic>
<pdfEncoding>Identity-H</pdfEncoding>
<pdfEmbedded>true</pdfEmbedded>
<exportFonts>
<export key="net.sf.jasperreports.html">Arial, Helvetica, sans-serif</export>
<export key="net.sf.jasperreports.xhtml">Arial, Helvetica, sans-serif</export>
</exportFonts>
</fontFamily>




POM:



<dependencies>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.5.0</version>
<exclusions>
<exclusion>
<groupId>jfree</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>bouncycastle</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>eclipse</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.castor</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports-fonts</artifactId>
<version>6.0.0</version>
</dependency>

<dependency>
<groupId>net.sourceforge.barbecue</groupId>
<artifactId>barbecue</artifactId>
<version>1.5-beta1</version>
</dependency>

<dependency>
<groupId>pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>0.7.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>

<build>

<pluginManagement>
<plugins>
<plugin>
<groupId>net.sourceforge.maven-taglib</groupId>
<artifactId>maven-taglib-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<goals>
<goal>taglibdocjar</goal>
</goals>
</execution>
</executions>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<versionRange>[1.0-beta-2,)</versionRange>
<goals>
<goal>compile-reports</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>net.sourceforge.maven-taglib</groupId>
<artifactId>maven-taglib-plugin</artifactId>
<version>2.4</version>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<version>1.0-beta-2</version>
<configuration>
<sourceDirectory>src/main/resources</sourceDirectory>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<compiler>net.sf.jasperreports.engine.design.JRJdtCompiler</compiler>
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.5.0</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api</artifactId>
<version>3.0.20100224</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile-reports</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>




The error:



19/11/18 00:00:00 DEBUG BaseReportFiller.<init>:149 - Fill 1: created for boleto-default
19/11/18 00:00:01 DEBUG BaseReportFiller.<init>:177 - created delayed actions 1 for filler 1
19/11/18 00:00:01 DEBUG ExtensionsEnvironment.createDefaultRegistry:87 - Instantiating extensions registry class net.sf.jasperreports.extensions.DefaultExtensionsRegistry
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.getRegistries:150 - Loading registries for cache key sun.misc.Launcher$AppClassLoader@70dea4e
19/11/18 00:00:01 DEBUG JRLoader.collectResources:791 - Found resource jasperreports_extension.properties at jar:file:/home/matheus/Downloads/myProject-1.0.0.jar!/jasperreports_extension.properties in classloader sun.misc.Launcher$AppClassLoader@70dea4e
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.loadRegistries:182 - Loading JasperReports extension properties resource jar:file:/home/matheus/Downloads/myProject-1.0.0.jar!/jasperreports_extension.properties
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.loadRegistries:264 - Instantiating registry of type net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.fonts
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.instantiateRegistry:289 - Instantiating extensions registry for fonts using factory class net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
19/11/18 00:00:01 DEBUG FontExtensionsRegistry.ensureFontExtensions:88 - Loading font extensions from fonts.xml
Exception in thread "TestThread" java.lang.ExceptionInInitializerError
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:111)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:69)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:57)
at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:219)
at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:234)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:134)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:667)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:648)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:970)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraRelatorio(GeradorDeBoleto.java:119)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraPDF(GeradorDeBoleto.java:160)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraPDF(GeradorDeBoleto.java:210)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraPDFStream(GeradorDeBoleto.java:229)
at br.com.company.test.TestThread.run(TestThread.java:57)
at java.lang.Thread.run(Thread.java:748)









share|improve this question























  • You have some more stacktrace for it?, is there another "Caused by"?

    – Petter Friberg
    Nov 21 '18 at 15:41











  • No. Only this show to me

    – Matheus Oliveira
    Nov 21 '18 at 15:58






  • 1





    Maybe problem with font.xml but I would not be 100÷ sure its actually the xml, that type error you get can get from problem loading a font (in stream) problem parsing jrxml (xerces hell) we would need some more info about the actual error

    – Petter Friberg
    Nov 21 '18 at 16:03














0












0








0


1






I just finished a project, but when i put it in the production environment the JasperReport presents error on font.xml. I try run the project on my machine on terminal (linux) and the same error apears, work only if i run on Netebeans. For why work on Netbeans and on terminal no?



My project is simple, i generate on PDF and send it by e-mail. The structure is:



enter image description here



jasperreports_extension.properties:



net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
net.sf.jasperreports.extension.simple.font.families.arial=fonts.xml


fonts.xml:






<fontFamily name="Arial">
<normal>fonts/Arial.ttf</normal>
<bold>fonts/Arial Bold.ttf</bold>
<italic>fonts/Arial Italic.ttf</italic>
<boldItalic>fonts/Arial Bold Italic.ttf</boldItalic>
<pdfEncoding>Identity-H</pdfEncoding>
<pdfEmbedded>true</pdfEmbedded>
<exportFonts>
<export key="net.sf.jasperreports.html">Arial, Helvetica, sans-serif</export>
<export key="net.sf.jasperreports.xhtml">Arial, Helvetica, sans-serif</export>
</exportFonts>
</fontFamily>




POM:



<dependencies>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.5.0</version>
<exclusions>
<exclusion>
<groupId>jfree</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>bouncycastle</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>eclipse</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.castor</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports-fonts</artifactId>
<version>6.0.0</version>
</dependency>

<dependency>
<groupId>net.sourceforge.barbecue</groupId>
<artifactId>barbecue</artifactId>
<version>1.5-beta1</version>
</dependency>

<dependency>
<groupId>pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>0.7.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>

<build>

<pluginManagement>
<plugins>
<plugin>
<groupId>net.sourceforge.maven-taglib</groupId>
<artifactId>maven-taglib-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<goals>
<goal>taglibdocjar</goal>
</goals>
</execution>
</executions>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<versionRange>[1.0-beta-2,)</versionRange>
<goals>
<goal>compile-reports</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>net.sourceforge.maven-taglib</groupId>
<artifactId>maven-taglib-plugin</artifactId>
<version>2.4</version>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<version>1.0-beta-2</version>
<configuration>
<sourceDirectory>src/main/resources</sourceDirectory>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<compiler>net.sf.jasperreports.engine.design.JRJdtCompiler</compiler>
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.5.0</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api</artifactId>
<version>3.0.20100224</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile-reports</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>




The error:



19/11/18 00:00:00 DEBUG BaseReportFiller.<init>:149 - Fill 1: created for boleto-default
19/11/18 00:00:01 DEBUG BaseReportFiller.<init>:177 - created delayed actions 1 for filler 1
19/11/18 00:00:01 DEBUG ExtensionsEnvironment.createDefaultRegistry:87 - Instantiating extensions registry class net.sf.jasperreports.extensions.DefaultExtensionsRegistry
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.getRegistries:150 - Loading registries for cache key sun.misc.Launcher$AppClassLoader@70dea4e
19/11/18 00:00:01 DEBUG JRLoader.collectResources:791 - Found resource jasperreports_extension.properties at jar:file:/home/matheus/Downloads/myProject-1.0.0.jar!/jasperreports_extension.properties in classloader sun.misc.Launcher$AppClassLoader@70dea4e
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.loadRegistries:182 - Loading JasperReports extension properties resource jar:file:/home/matheus/Downloads/myProject-1.0.0.jar!/jasperreports_extension.properties
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.loadRegistries:264 - Instantiating registry of type net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.fonts
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.instantiateRegistry:289 - Instantiating extensions registry for fonts using factory class net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
19/11/18 00:00:01 DEBUG FontExtensionsRegistry.ensureFontExtensions:88 - Loading font extensions from fonts.xml
Exception in thread "TestThread" java.lang.ExceptionInInitializerError
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:111)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:69)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:57)
at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:219)
at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:234)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:134)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:667)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:648)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:970)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraRelatorio(GeradorDeBoleto.java:119)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraPDF(GeradorDeBoleto.java:160)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraPDF(GeradorDeBoleto.java:210)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraPDFStream(GeradorDeBoleto.java:229)
at br.com.company.test.TestThread.run(TestThread.java:57)
at java.lang.Thread.run(Thread.java:748)









share|improve this question














I just finished a project, but when i put it in the production environment the JasperReport presents error on font.xml. I try run the project on my machine on terminal (linux) and the same error apears, work only if i run on Netebeans. For why work on Netbeans and on terminal no?



My project is simple, i generate on PDF and send it by e-mail. The structure is:



enter image description here



jasperreports_extension.properties:



net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
net.sf.jasperreports.extension.simple.font.families.arial=fonts.xml


fonts.xml:






<fontFamily name="Arial">
<normal>fonts/Arial.ttf</normal>
<bold>fonts/Arial Bold.ttf</bold>
<italic>fonts/Arial Italic.ttf</italic>
<boldItalic>fonts/Arial Bold Italic.ttf</boldItalic>
<pdfEncoding>Identity-H</pdfEncoding>
<pdfEmbedded>true</pdfEmbedded>
<exportFonts>
<export key="net.sf.jasperreports.html">Arial, Helvetica, sans-serif</export>
<export key="net.sf.jasperreports.xhtml">Arial, Helvetica, sans-serif</export>
</exportFonts>
</fontFamily>




POM:



<dependencies>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.5.0</version>
<exclusions>
<exclusion>
<groupId>jfree</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>bouncycastle</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>eclipse</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.castor</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports-fonts</artifactId>
<version>6.0.0</version>
</dependency>

<dependency>
<groupId>net.sourceforge.barbecue</groupId>
<artifactId>barbecue</artifactId>
<version>1.5-beta1</version>
</dependency>

<dependency>
<groupId>pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>0.7.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>

<build>

<pluginManagement>
<plugins>
<plugin>
<groupId>net.sourceforge.maven-taglib</groupId>
<artifactId>maven-taglib-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<goals>
<goal>taglibdocjar</goal>
</goals>
</execution>
</executions>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<versionRange>[1.0-beta-2,)</versionRange>
<goals>
<goal>compile-reports</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>net.sourceforge.maven-taglib</groupId>
<artifactId>maven-taglib-plugin</artifactId>
<version>2.4</version>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<version>1.0-beta-2</version>
<configuration>
<sourceDirectory>src/main/resources</sourceDirectory>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<compiler>net.sf.jasperreports.engine.design.JRJdtCompiler</compiler>
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.5.0</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api</artifactId>
<version>3.0.20100224</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile-reports</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>




The error:



19/11/18 00:00:00 DEBUG BaseReportFiller.<init>:149 - Fill 1: created for boleto-default
19/11/18 00:00:01 DEBUG BaseReportFiller.<init>:177 - created delayed actions 1 for filler 1
19/11/18 00:00:01 DEBUG ExtensionsEnvironment.createDefaultRegistry:87 - Instantiating extensions registry class net.sf.jasperreports.extensions.DefaultExtensionsRegistry
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.getRegistries:150 - Loading registries for cache key sun.misc.Launcher$AppClassLoader@70dea4e
19/11/18 00:00:01 DEBUG JRLoader.collectResources:791 - Found resource jasperreports_extension.properties at jar:file:/home/matheus/Downloads/myProject-1.0.0.jar!/jasperreports_extension.properties in classloader sun.misc.Launcher$AppClassLoader@70dea4e
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.loadRegistries:182 - Loading JasperReports extension properties resource jar:file:/home/matheus/Downloads/myProject-1.0.0.jar!/jasperreports_extension.properties
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.loadRegistries:264 - Instantiating registry of type net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.fonts
19/11/18 00:00:01 DEBUG DefaultExtensionsRegistry.instantiateRegistry:289 - Instantiating extensions registry for fonts using factory class net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
19/11/18 00:00:01 DEBUG FontExtensionsRegistry.ensureFontExtensions:88 - Loading font extensions from fonts.xml
Exception in thread "TestThread" java.lang.ExceptionInInitializerError
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:111)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:69)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:57)
at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:219)
at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:234)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:134)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:667)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:648)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:970)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraRelatorio(GeradorDeBoleto.java:119)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraPDF(GeradorDeBoleto.java:160)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraPDF(GeradorDeBoleto.java:210)
at br.com.caelum.stella.boleto.transformer.GeradorDeBoleto.geraPDFStream(GeradorDeBoleto.java:229)
at br.com.company.test.TestThread.run(TestThread.java:57)
at java.lang.Thread.run(Thread.java:748)






java linux fonts jasper-reports






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 '18 at 12:49









Matheus OliveiraMatheus Oliveira

568813




568813













  • You have some more stacktrace for it?, is there another "Caused by"?

    – Petter Friberg
    Nov 21 '18 at 15:41











  • No. Only this show to me

    – Matheus Oliveira
    Nov 21 '18 at 15:58






  • 1





    Maybe problem with font.xml but I would not be 100÷ sure its actually the xml, that type error you get can get from problem loading a font (in stream) problem parsing jrxml (xerces hell) we would need some more info about the actual error

    – Petter Friberg
    Nov 21 '18 at 16:03



















  • You have some more stacktrace for it?, is there another "Caused by"?

    – Petter Friberg
    Nov 21 '18 at 15:41











  • No. Only this show to me

    – Matheus Oliveira
    Nov 21 '18 at 15:58






  • 1





    Maybe problem with font.xml but I would not be 100÷ sure its actually the xml, that type error you get can get from problem loading a font (in stream) problem parsing jrxml (xerces hell) we would need some more info about the actual error

    – Petter Friberg
    Nov 21 '18 at 16:03

















You have some more stacktrace for it?, is there another "Caused by"?

– Petter Friberg
Nov 21 '18 at 15:41





You have some more stacktrace for it?, is there another "Caused by"?

– Petter Friberg
Nov 21 '18 at 15:41













No. Only this show to me

– Matheus Oliveira
Nov 21 '18 at 15:58





No. Only this show to me

– Matheus Oliveira
Nov 21 '18 at 15:58




1




1





Maybe problem with font.xml but I would not be 100÷ sure its actually the xml, that type error you get can get from problem loading a font (in stream) problem parsing jrxml (xerces hell) we would need some more info about the actual error

– Petter Friberg
Nov 21 '18 at 16:03





Maybe problem with font.xml but I would not be 100÷ sure its actually the xml, that type error you get can get from problem loading a font (in stream) problem parsing jrxml (xerces hell) we would need some more info about the actual error

– Petter Friberg
Nov 21 '18 at 16:03












1 Answer
1






active

oldest

votes


















0














With the suggestion of @Petter Friberg i was able to identify the real origin of my error, who was in the Jasper Report properties file.



Below is the link that helped me solve my problem:



Jasperreports engine JRRuntimeException on report().show






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53412417%2fjasperreport-exception-fontextensionsregistry-ensurefontextensions-loading-fon%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    With the suggestion of @Petter Friberg i was able to identify the real origin of my error, who was in the Jasper Report properties file.



    Below is the link that helped me solve my problem:



    Jasperreports engine JRRuntimeException on report().show






    share|improve this answer




























      0














      With the suggestion of @Petter Friberg i was able to identify the real origin of my error, who was in the Jasper Report properties file.



      Below is the link that helped me solve my problem:



      Jasperreports engine JRRuntimeException on report().show






      share|improve this answer


























        0












        0








        0







        With the suggestion of @Petter Friberg i was able to identify the real origin of my error, who was in the Jasper Report properties file.



        Below is the link that helped me solve my problem:



        Jasperreports engine JRRuntimeException on report().show






        share|improve this answer













        With the suggestion of @Petter Friberg i was able to identify the real origin of my error, who was in the Jasper Report properties file.



        Below is the link that helped me solve my problem:



        Jasperreports engine JRRuntimeException on report().show







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 22 '18 at 16:46









        Matheus OliveiraMatheus Oliveira

        568813




        568813
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53412417%2fjasperreport-exception-fontextensionsregistry-ensurefontextensions-loading-fon%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            MongoDB - Not Authorized To Execute Command

            How to fix TextFormField cause rebuild widget in Flutter

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith