July 1, 2022
Print subsystem not working on CF2021 and Ubuntu 20.04
Comments
(2)
July 1, 2022
Print subsystem not working on CF2021 and Ubuntu 20.04
Newbie 1 posts
Followers: 0 people
(2)

Hi,
I’have installed a CF2021 instance on Ubuntu 20.04 and now I have problem with the printing subsystem.

CF gives me the error reported below whenever I try to create a PDF trough CFDOCUMENT or CFREPORT.

I’ve double checked that all the necessary modules are installed and even tried to unload and reinstall the print, document, PDF, Html2Pdf, and Report but nothing works… the error seems to be related with the loading of the fonts but I couldn’t find any solution on other discussion forums.

Can someone help me solving this issue?

Many thanks in advance for any suggestion!
Gherardo

—————————

An exception occurred when performing document processing.

The cause of this exception was that: java.lang.InternalError: java.lang.reflect.InvocationTargetException.
java.lang.InternalError: java.lang.reflect.InvocationTargetException
	at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:86)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
	at java.desktop/sun.font.SunFontManager.getInstance(SunFontManager.java:247)
	at java.desktop/sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:265)
	at java.desktop/sun.java2d.SunGraphics2D.getFontMetrics(SunGraphics2D.java:864)
	at ice.pilots.html4.FractionalDeviceFontProvider.getFontMetrics(FractionalDeviceFontProvider.java:63)
	at ice.pilots.html4.FontCache.loadNewFont(FontCache.java:742)
	at ice.pilots.html4.FontCache.getFontMetrics(FontCache.java:710)
	at ice.pilots.html4.CSSAttribs.getFontMetrics(CSSAttribs.java:380)
	at ice.pilots.html4.CSSAttribs.getFont(CSSAttribs.java:368)
	at ice.pilots.html4.TextBox.initBreaks(TextBox.java:209)
	at ice.pilots.html4.TextBox.calcBreaks(TextBox.java:134)
	at ice.pilots.html4.InlineBox.calcBreaks(InlineBox.java:439)
	at ice.pilots.html4.BlockBox.calcMinMaxWidths(BlockBox.java:297)
	at ice.pilots.html4.BlockBox.calcMinMaxWidths(BlockBox.java:231)
	at ice.pilots.html4.BlockBox.calcMinMaxWidths(BlockBox.java:231)
	at ice.pilots.html4.BlockBox.calcMinMaxWidths(BlockBox.java:231)
	at ice.pilots.html4.CSSLayout.do_layout(CSSLayout.java:836)
	at ice.pilots.html4.CSSLayout.layout(CSSLayout.java:777)
	at ice.pilots.html4.ThePrinter.<init>(ThePrinter.java:72)
	at ice.pilots.html4.ThePilot.createCSSLayout(ThePilot.java:235)
	at ice.pilots.html4.ThePilot.createPrinter(ThePilot.java:330)
	at coldfusion.document.DocumentExporter.export(DocumentExporter.java:112)
	at coldfusion.document.DocumentExporter.export(DocumentExporter.java:38)
	at coldfusion.document.DocumentFrame.exportContent(DocumentFrame.java:162)
	at coldfusion.document.DocumentProcessor.processContent(DocumentProcessor.java:292)
	at coldfusion.document.DocumentProcessor.processContent(DocumentProcessor.java:179)
	at coldfusion.tagext.document.DocumentTag.processContent(DocumentTag.java:1872)
	at coldfusion.tagext.document.DocumentTag._processContent(DocumentTag.java:1773)
	at coldfusion.tagext.document.DocumentTag.doAfterBody(DocumentTag.java:1705)
	at cfviewPrtDashboard2ecfm1056706903.runPage(/var/www/html/Web-SDV036/_Project/Views/viewPrtDashboard.cfm:74)
	at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:257)
	at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:749)
	at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:578)
	at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
	at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:573)
	at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:43)
	at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
	at coldfusion.filter.PathFilter.invoke(PathFilter.java:162)
	at coldfusion.filter.IpFilter.invoke(IpFilter.java:45)
	at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:97)
	at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
	at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
	at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:60)
	at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
	at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
	at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
	at coldfusion.CfmServlet.service(CfmServlet.java:231)
	at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:311)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:228)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)
	at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:46)
	at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:47)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)
	at coldfusion.inspect.weinre.MobileDeviceDomInspectionFilter.doFilter(MobileDeviceDomInspectionFilter.java:57)
	at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:47)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:373)
	at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:462)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1723)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:84)
	... 78 more
Caused by: java.lang.NullPointerException
	at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262)
	at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225)
	at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107)
	at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719)
	at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:367)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/sun.font.SunFontManager.<init>(SunFontManager.java:312)
	at java.desktop/sun.awt.FcFontManager.<init>(FcFontManager.java:35)
	at java.desktop/sun.awt.X11FontManager.<init>(X11FontManager.java:56)
	... 83 more
2 Comments
2022-07-29 03:15:34
2022-07-29 03:15:34

Gherardo?

Like
2022-07-11 15:54:28
2022-07-11 15:54:28

Gherardo, I have more questions than answers, to start with. Perhaps someone else may offer the exact solution you need, or they may better once you answer some of these questions. (And let me note first that I don’t think this has to do with “printing” at all. More on that in a moment.)

But as you note it’s a “font” problem. And more specifically I notice the top of your stack trace (what it was doing last, before the request failed) it refers to “doPrivileged”. That suggests perhaps a permissions problem (though not necessarily). Whether that’s so or not, there are a few things you could tell us, to help us help you:

  • As for the font you are trying to use (within the html of cfdocument), is it listed in the CF Admin “font management” page, within the (first) “Server Settings” section?
  • If it is, note the final “path” column, indicating the folder in which the font exists
  • Now note what user your CF instance is running as. This was chosen at installation of CF, and you can see it also in the Linux top or ps commands
  • Does that user have permission to that font folder?
  • Are you running selinux?
  • Also, as for this Linux implementation of CF2021, did you (or someone there) do it using the “zip” install approach or the “full” installer? If the zip approach, did you (or someone there) run the cfsetup.sh script after doing that?
  • What update of CF are you on? And what JVM version? See the CF Admin “settings summary” page (in the same section), which indicates these
  • What hotfixes, if any, have you applied? You can see this in the lib/updates folder (under CF’s cfusion folder, or any other instance folder that’s a sibling to that). If there are any files there which start with “hf” (versus “chf”), those are special Adobe-provided hotfixes, meant to fix bugs until a later CF update includes them by default
  • Other than any CF updates, hotfixes, or Java updates, would you think this is otherwise a “stock” install of CF? Or do you or your folks find yourself needing to “tweak” things, whether adding new jars and files to CF, or removing any (such as for log4j concerns), or tweaking the JVM arguments that startup CF (in the CF Admin or jvm.config file)?

Again, sorry for “twenty questions”, but your answers to these questions will better help us all be on the same page with you. It’s easy to think what one experiences should be what everyone does, but variations like the above can make a big difference in why you may experience a given problem that others don’t seem to.

Some additional context on this not being a “print” problem

Finally, as for it being a font vs print problem, I’ll just share if it may help you or others that I do realize that the stack trace you show has the word “print” in it, but that’s in the context of the CFDOCUMENT tag you are doing, also indicated in the middle of that stack trace as the tag being what’s running (at the time of the stack trace), and as found on your line 74 of /var/www/html/Web-SDV036/_Project/Views/viewPrtDashboard.cfm.

Again, more important (as for solving your problem) is what’s found toward the TOP of your stack trace, where it shows the underlying processing of that cfdocument to be trying to load fonts.  And yes, I know you acknowledge that later. I just mean that your title here and opening sentences cast this as a “print subsystem” problem. The print subsystem would be called upon if you used a tag like CFPRINT, to print a document on a printer.

As for the “print” references you see in the stack trace, that’s about how cfdocument under the covers tries to “print” the HTML (generated from your CFML, within that tag) to a virtual browser (the “ice” browser, also referred to in the stack trace), and that underlying “ice browser” engine is what renders it as a virtual browser and then passes it to the underlying itext library to convert the HTML into a pdf (not indicated in this stack trace, because the problem that kept it from getting to that point).

Like
Add Comment