Font Extension not working in Wildfly project

0

The Application is build by maven and a dependency to the Font Extension is included as local project. The jar is added to WEB-INF-directory.

The Application, the automated end2end test and the deployment worked on Windows before (without the Font Extension) by adding the Font manually to the relevant systems.

Now the Application is build by a Docker - System (linux), and the image/container has no additional fonts, so the font could not be found and the pdf is not created, the test case fails.

The Jar is found available as a resource:
Output by code snipet in the deployed application:
    ClassLoader cl = Thread.currentThread().getContextClassLoader();

    Enumeration<URL> resources;
    try {
      resources = cl.getResources("");
      while (resources.hasMoreElements()) {
        try {
          LOG.info("Ressorce: " + resources.nextElement().toURI());
        } catch (URISyntaxException e) {
          LOG.info("Ressource URI:", e);
        }
      }
    } catch (IOException e) {
      LOG.info("Resource IO:", e);
    }

...
...SNAPSHOT.war/WEB-INF/lib/HelveticaExtension-1.0.jar/
...

Problem: 

<span style="font-size:11px"><strong>net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'fonts/HelveticaExtension_10/Helvetica.otf' is not available to the JVM. See the Javadoc for more details.</strong></span>

The jar is found and read since the report only references HelveticaExtension-1.0, and the font name is in the fontsfamily1593602081303.xml:

<?xml version="1.0" encoding="UTF-8"?>
<fontFamilies>
<fontFamily name="HelveticaExtension-1.0">
<normal>fonts/HelveticaExtension_10/Helvetica.otf</normal>
<pdfEncoding>Cp1252</pdfEncoding>
<exportFonts>
</exportFonts>
</fontFamily>
</fontFamilies>

the .properties file contains

net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
net.sf.jasperreports.extension.simple.font.families.ireportfamily1593602081303=fonts/fontsfamily1593602081303.xml

The Components are

Wildfly 8.2
jasperreports-5.6.0.jar/

Any help would be appreciated.

Bisonier

Bisonier's picture
Joined: Jul 3 2020 - 12:02am
Last seen: 5 months 2 weeks ago

0 Answers:

No answers yet
Feedback