OpenJdk 11 : Issue while generating jasper reports

0

Looks like the font configuration has been removed in JDK 11. Same with Oracle JDK or OpenJDK.

Jasper Report Library : 6.9.0
Jasper Report Studio :  6.9.0

2019-07-23 00:18:32,809 ERROR [net.sf.jasperreports.engine.util.JRStyledTextParser] (default task-6) Error while loading available fonts: java.lang.ClassCastException: class sun.font.CompositeFont cannot be cast to class sun.font.PhysicalFont (sun.font.CompositeFont and sun.font.PhysicalFont are in module java.desktop of loader 'bootstrap') at java.desktop/sun.font.SunFontManager.getDefaultPhysicalFont(Unknown Source) at java.desktop/sun.font.SunFontManager.initialiseDeferredFont(Unknown Source) at java.desktop/sun.font.SunFontManager.initialiseDeferredFonts(Unknown Source) at java.desktop/sun.font.SunFontManager.loadFonts(Unknown Source) at java.desktop/sun.awt.X11FontManager.loadFonts(Unknown Source) at java.desktop/sun.font.SunFontManager.loadFontFiles(Unknown Source) at java.desktop/sun.font.SunFontManager.getInstalledFontFamilyNames(Unknown Source) at java.desktop/sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(Unknown Source) at java.desktop/sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(Unknown Source) at java.desktop/sun.java2d.HeadlessGraphicsEnvironment.getAvailableFontFamilyNames(Unknown Source) at deployment.ROOT.war//net.sf.jasperreports.engine.util.JRStyledTextParser.(JRStyledTextParser.java:95) at deployment.ROOT.war//net.sf.jasperreports.engine.fill.JRBaseFiller.(JRBaseFiller.java:116) at deployment.ROOT.war//net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:79) at deployment.ROOT.war//net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:251) at deployment.ROOT.war//net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:272) at deployment.ROOT.war//net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:156) at deployment.ROOT.war//net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:651) at deployment.ROOT.war//net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:1020) at org.apache.jsp.jsp.ShowReport_jsp._jspService(ShowReport_jsp.java:331) at io.undertow.jsp//org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.api//javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at io.undertow.jsp//org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433) at io.undertow.jsp//org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403) at io.undertow.jsp//org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347) at javax.servlet.api//javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at io.undertow.servlet//io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) at io.undertow.servlet//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) at deployment.ROOT.war//com.exilant.pathFinder.ClickjackFilter.doFilter(ClickjackFilter.java:26) at io.undertow.servlet//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) at io.undertow.servlet//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at deployment.ROOT.war//com.exilant.exility.core.validateURL2.doFilter(validateURL2.java:276) at io.undertow.servlet//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) at io.undertow.servlet//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.undertow.servlet//io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) at io.undertow.servlet//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) at io.undertow.jsp//io.undertow.jsp.JspFileHandler.handleRequest(JspFileHandler.java:32) at io.undertow.servlet//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:67) at io.undertow.servlet//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) at org.wildfly.extension.undertow//org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78) at io.undertow.core@2.0.0.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet//io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) at io.undertow.servlet//io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) at io.undertow.core@2.0.0.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.core@2.0.0.Final//io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) at io.undertow.servlet//io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) at io.undertow.core@2.0.0.Final//io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) at io.undertow.servlet//io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) at io.undertow.core@2.0.0.Final//io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) at io.undertow.core@2.0.0.Final//io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) at io.undertow.core@2.0.0.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at org.wildfly.extension.undertow//org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61) at io.undertow.core@2.0.0.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at org.wildfly.extension.undertow//org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68) at io.undertow.core@2.0.0.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292) at io.undertow.servlet//io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81) at io.undertow.servlet//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138) at io.undertow.servlet//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) at io.undertow.servlet//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) at io.undertow.servlet//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) at org.wildfly.extension.undertow//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105) at org.wildfly.extension.undertow//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526) at org.wildfly.extension.undertow//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526) at org.wildfly.extension.undertow//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526) at org.wildfly.extension.undertow//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526) at io.undertow.servlet//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272) at io.undertow.servlet//io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) at io.undertow.servlet//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104) at io.undertow.core@2.0.0.Final//io.undertow.server.Connectors.executeRootHandler(Connectors.java:360) at io.undertow.core@2.0.0.Final//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) at org.jboss.threads@2.3.1.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads@2.3.1.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985) at org.jboss.threads@2.3.1.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487) at org.jboss.threads@2.3.1.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378) at java.base/java.lang.Thread.run(Unknown Source)

guruprasad.sarathy's picture
Joined: Jul 23 2019 - 2:05pm
Last seen: 1 month 3 weeks ago

1 Answer:

1

I had this problem when I upgraded from JDK8 to JDK11.

I solved it by installing the 'fontconfig' package on the server and restarting the application server.

fabio.fbsistemas's picture
Joined: Aug 6 2019 - 2:13am
Last seen: 1 day 18 hours ago
Feedback