NullPointerException: Apache Tomcat 10.0.23 (latest), Debian 11 (headless)

0 votes
asked Aug 27 in Bug by anonymous
retagged Aug 27
org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [svgservlet] in context with path [/plantuml-jsp-v1.2022.7] threw exception [Servlet execution threw an exception] with root cause
        java.lang.ExceptionInInitializerError: Exception java.lang.NullPointerException [in thread "http-nio-8090-exec-6"]
                at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262)
                at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:224)
                at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:106)
                at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:706)
                at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:352)
                at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:309)
                at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
                at java.desktop/sun.font.SunFontManager.<init>(SunFontManager.java:309)
                at java.desktop/sun.awt.FcFontManager.<init>(FcFontManager.java:35)
                at java.desktop/sun.awt.X11FontManager.<init>(X11FontManager.java:56)
                at java.desktop/sun.font.PlatformFontInfo.createFontManager(PlatformFontInfo.java:37)
                at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:51)
                at java.desktop/sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:137)
                at java.desktop/sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:171)
                at java.desktop/sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:195)
                at java.desktop/sun.java2d.HeadlessGraphicsEnvironment.getAvailableFontFamilyNames(HeadlessGraphicsEnvironment.java:80)
                at net.sourceforge.plantuml.ugraphic.UFont.<clinit>(UFont.java:53)
                at net.sourceforge.plantuml.style.Style.getUFont(Style.java:186)
                at net.sourceforge.plantuml.style.Style.getFontConfiguration(Style.java:194)
                at net.sourceforge.plantuml.style.Style.getFontConfiguration(Style.java:190)
                at net.sourceforge.plantuml.skin.AbstractTextualComponent.<init>(AbstractTextualComponent.java:85)
                at net.sourceforge.plantuml.skin.rose.ComponentRoseParticipant.<init>(ComponentRoseParticipant.java:69)
                at net.sourceforge.plantuml.skin.rose.Rose.createComponent(Rose.java:137)
                at net.sourceforge.plantuml.sequencediagram.graphic.DrawableSetInitializer.prepareParticipant(DrawableSetInitializer.java:622)
                at net.sourceforge.plantuml.sequencediagram.graphic.DrawableSetInitializer.createDrawableSet(DrawableSetInitializer.java:142)
                at net.sourceforge.plantuml.sequencediagram.graphic.SequenceDiagramFileMakerPuma2.<init>(SequenceDiagramFileMakerPuma2.java:105)
                at net.sourceforge.plantuml.sequencediagram.SequenceDiagram.getSequenceDiagramPngMaker(SequenceDiagram.java:267)
                at net.sourceforge.plantuml.sequencediagram.SequenceDiagram.exportDiagramInternal(SequenceDiagram.java:282)
                at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:135)
                at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:178)
                at net.sourceforge.plantuml.servlet.DiagramResponse.sendDiagram(DiagramResponse.java:170)
                at net.sourceforge.plantuml.servlet.UmlDiagramService.doDiagramResponse(UmlDiagramService.java:108)
                at net.sourceforge.plantuml.servlet.UmlDiagramService.doGet(UmlDiagramService.java:70)
                at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:668)
                at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:777)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:223)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
                at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
                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:119)
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
                at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:356)
                at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
                at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
                at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:867)
                at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1762)
                at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
                at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
                at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
                at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
                at java.base/java.lang.Thread.run(Thread.java:833)

1 Answer

0 votes
answered Aug 27 by anonymous
 
Best answer
SOLUTION - missing package on headless server installation

e.g. on debian-bullseye you need to install the following package and its dependencies

https://packages.debian.org/bullseye/fontconfig
...