jdk11 cannot display graph

报错

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
java.lang.NoClassDefFoundError: Could not initialize class sun.font.SunFontManager
      at java.desktop/sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:265)
      at java.desktop/java.awt.Font.getStringBounds(Font.java:2607)
      at java.desktop/java.awt.Font.getStringBounds(Font.java:2517)
      at java.desktop/java.awt.Font.getStringBounds(Font.java:2551)
      at org.jrobin.graph.ImageWorker.getStringWidth(ImageWorker.java:166)
      at org.jrobin.graph.RrdGraph.getSmallFontCharWidth(RrdGraph.java:594)
      at org.jrobin.graph.RrdGraph.initializeLimits(RrdGraph.java:319)
      at org.jrobin.graph.RrdGraph.createGraph(RrdGraph.java:88)
      at org.jrobin.graph.RrdGraph.<init>(RrdGraph.java:59)
      at net.bull.javamelody.internal.model.JRobin.graph(JRobin.java:262)
      at net.bull.javamelody.internal.web.MonitoringController.doGraph(MonitoringController.java:394)
      at net.bull.javamelody.internal.web.MonitoringController.doReport(MonitoringController.java:192)
      at net.bull.javamelody.internal.web.MonitoringController.doActionIfNeededAndReport(MonitoringController.java:163)
      at net.bull.javamelody.MonitoringFilter.doMonitoring(MonitoringFilter.java:408)
      at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
      at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
      at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

解决办法安装,安装 fontconfig

1
So, in my case apt-get install fontconfig solved the problem permanently.

image-20230525154157247

参考文档:

https://github.com/javamelody/javamelody/issues/819

Licensed under CC BY-NC-SA 4.0
最后更新于 Jan 06, 2025 05:52 UTC
comments powered by Disqus
Built with Hugo
主题 StackJimmy 设计
Caret Up