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)
版本号:
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 会有上述错误,大概率是什么原因呢。 测试 生产
友情提示(为了提高issue处理效率):