Fonts Problems with iReport 5.6 in netbeans 8.0

2k Views Asked by At

This is my first post, I hope it's ok. I keep having this trouble with iReport. The thing is that I've found a lot of forums showing how to install a font, but in this case the exception seems to be in pictonic font. This same project was working until I formatted my notebook, I've installed Netbeans 8.0 again and iReports 5.6. I've already installed the plugins and libraries are in the classpath. I've been trying with some other libraries, adding to the jrxml some "ignore font exception" command but nothing... This is what Glassfish says to me:

    Advertencia:   StandardWrapperValve[ServicioReporte]: Servlet.service() for servlet          ServicioReporte threw exception
java.lang.ExceptionInInitializerError
    at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:121)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:88)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:103)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:61)
    at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:153)
    at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:55)
    at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446)
    at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:276)
    at net.sf.jasperreports.engine.JasperRunManager.runToPdf(JasperRunManager.java:245)
    at net.sf.jasperreports.engine.JasperRunManager.runReportToPdf(JasperRunManager.java:746)
    at Controladores.ServicioReporte.processRequest(ServicioReporte.java:68)
    at Controladores.ServicioReporte.doPost(ServicioReporte.java:259)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
    at java.lang.Thread.run(Thread.java:745)
Caused by: net.sf.jasperreports.engine.util.JRFontNotFoundException: Font '
            net/sf/jasperreports/fonts/pictonic/pictonic.ttf
            net/sf/jasperreports/fonts/pictonic/pictonic.svg
            net/sf/jasperreports/fonts/pictonic/pictonic.eot
            net/sf/jasperreports/fonts/pictonic/pictonic.woff
        ' is not available to the JVM. See the Javadoc for more details.
    at net.sf.jasperreports.engine.util.JRFontUtil.checkAwtFont(JRFontUtil.java:358)
    at net.sf.jasperreports.engine.fonts.SimpleFontFace.getInstance(SimpleFontFace.java:72)
    at net.sf.jasperreports.engine.fonts.SimpleFontFamily.setNormal(SimpleFontFamily.java:99)
    at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontFamily(SimpleFontExtensionHelper.java:261)
    at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontFamilies(SimpleFontExtensionHelper.java:232)
    at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontFamilies(SimpleFontExtensionHelper.java:193)
    at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontFamilies(SimpleFontExtensionHelper.java:162)
    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)
    ... 41 more

If anyone could please help me I'll be so thankfull!!! P.S: sorry for my English

2

There are 2 best solutions below

2
On

The reason you are getting the exception is because the fonts you want to use is not available with JVM.

However if you want to use some fonts, you need to create a font extension for it. This would supply JVM the requires fonts.

Visit this for more on custom fonts and its creation.

0
On

I had same problem, there was no way to load pictonic fonts which was included on jasper jar. I changed the JVM I was using (DCEVM to improve JVM HotSwap) with a regular JVM 7 and it worked. I don't know if it's a DCEVM issue or just a misconfiguration but I will avoid DCEVM this time.