NullPointerException – generate report in jasper-Collection of common programming errors
I’m having a problem when generating reports with Jasper Reports.
My intention is to generate a report for each user, but it only generates a single pdf.
Grave: Error instantiating extensions registry for fonts
java.lang.NullPointerException
at net.sf.jasperreports.engine.fonts.SimpleFontFace.(SimpleFontFace.java:83)
at net.sf.jasperreports.engine.fonts.SimpleFontFamily.createFontFace(SimpleFontFamily.java:316)
at net.sf.jasperreports.engine.fonts.SimpleFontFamily.setItalic(SimpleFontFamily.java:101)
at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontFamily(SimpleFontExtensionHelper.java:241)
at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontFamilies(SimpleFontExtensionHelper.java:204)
at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontFamilies(SimpleFontExtensionHelper.java:173)
at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontFamilies(SimpleFontExtensionHelper.java:142)
at net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory.createRegistry(SimpleFontExtensionsRegistryFactory.java:63)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.instantiateRegistry(DefaultExtensionsRegistry.java:200)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.loadRegistries(DefaultExtensionsRegistry.java:175)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.loadRegistries(DefaultExtensionsRegistry.java:135)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getRegistries(DefaultExtensionsRegistry.java:121)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getExtensions(DefaultExtensionsRegistry.java:98)
at net.sf.jasperreports.engine.util.JRStyledTextParser.(JRStyledTextParser.java:76)
at net.sf.jasperreports.engine.fill.JRBaseFiller.(JRBaseFiller.java:181)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:76)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:86)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:56)
at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:142)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:52)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247)
at sige.comunicacao.participante.ServletEmitirCertificadoTodosParticipantes.emitirCertificado(ServletEmitirCertificadoTodosParticipantes.java:250)
at sige.comunicacao.participante.ServletEmitirCertificadoTodosParticipantes.doPost(ServletEmitirCertificadoTodosParticipantes.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
The code snippet that is generating the exception is:
// Aqui ele cria o relatório
impressao = JasperFillManager.fillReport(pathJasper
+ "/Certificado_Conclusao.jasper", parametros, con);
// exporta para pdf
JasperExportManager.exportReportToPdfFile(impressao, path
+ "/Certificado_Conclusao_" + cpf + ".pdf");
I am using the jasper reports 3.7.2
Anyone knows how to solve this? Thank you in advance