jeecgboot / JimuReport

「可视化报表、仪表盘、大屏」积木报表是一款类Excel操作风格,在线拖拽设计的报表工具。功能涵盖: 报表设计、打印设计、图形报表、仪表盘门户设计、大屏设计等,完全免费!秉承“简单、易用、专业”的产品理念,极大的降低报表开发难度、缩短开发周期、解决各类报表难题。
http://jimureport.com
GNU General Public License v3.0
6.45k stars 1.65k forks source link

Java 17集成积木报表,导出时报错 Could not initialize class sun.awt.X11FontManager #3106

Open chenranh opened 2 days ago

chenranh commented 2 days ago
版本号:

1.7.9

问题描述:

docker 运行集成积木报表 1.7.9 ,导出时报错 Could not initialize class sun.awt.X11FontManager

错误日志&截图:

2024-11-04 09:02:45.979 [http-nio-8085-exec-21] ERROR o.a.c.c.C.[.[localhost].[/].[dispatcherServlet]:175 - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.UnsatisfiedLinkError: /usr/local/openjdk-17/lib/libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory] with root cause java.lang.UnsatisfiedLinkError: /usr/local/openjdk-17/lib/libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory at java.base/jdk.internal.loader.NativeLibraries.load(Native Method) at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:384) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:228) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:170) at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:311) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:281) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2398) at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818) at java.base/java.lang.System.loadLibrary(System.java:1989) at java.desktop/sun.font.FontManagerNativeLibrary$1.run(FontManagerNativeLibrary.java:58) at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)

-----分割线-----

2024-11-04 09:05:53.876 [http-nio-8085-exec-22] ERROR o.a.c.c.C.[.[localhost].[/].[dispatcherServlet]:175 - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager] with root cause java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:467) at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83) at java.base/java.security.AccessController.doPrivileged(AccessController.java:318) at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:75) at java.desktop/java.awt.Font.getFont2D(Font.java:526) at java.desktop/java.awt.Font.canDisplayUpTo(Font.java:2282) at java.desktop/java.awt.font.TextLayout.singleFont(TextLayout.java:469) at java.desktop/java.awt.font.TextLayout.(TextLayout.java:530) at org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:273) at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.(AutoSizeColumnTracker.java:117) at org.apache.poi.xssf.streaming.SXSSFSheet.(SXSSFSheet.java:82) at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:684) at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:705) at org.jeecg.modules.jmreport.desreport.service.a.l.a(JmReportExportExcelImpl.java:613) at org.jeecg.modules.jmreport.desreport.service.a.l.a(JmReportExportExcelImpl.java:285) at org.jeecg.modules.jmreport.desreport.service.a.l.exportExcel(JmReportExportExcelImpl.java:147) at org.jeecg.modules.jmreport.desreport.a.a.b(DesignReportController.java:1323)

重现步骤:

本地 和测试环境运行没有问题。 生产使用了k8s 会有上述错误,大概率是什么原因呢。 测试 image 生产 image

友情提示(为了提高issue处理效率):

zhangdaiscott commented 2 days ago

集成的积木报表的那个版本,写清楚

zhangdaiscott commented 14 hours ago

无回复关闭

chenranh commented 14 hours ago

1.7.9 我重新修改了呀

zhangdaiscott commented 14 hours ago

依赖截图 你的架构详细说明

chenranh commented 14 hours ago

积木报表是独立部署的,测试环境使用docker运行 没发现问题 image 线上使用了k8s

chenranh commented 14 hours ago

和k8s部署相关吗? image

zhangdaiscott commented 13 hours ago

可能跟jdk有关,试试非openjdk