Closed imgoby closed 3 years ago
Thank you for reporting!
I see similar stacktrace from upstream OpenJDK issue JDK-8038987, but not sure if it is your case. Is it possible to share your test case to help with reproducing this issue?
resolve it by run: yum install fontconfig fc-cache --force
Description exception found while use dragonwell8 + easyexcel lib
Expected behavior java.lang.NullPointerException: null at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264) ~[na:1.8.0_222] at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219) ~[na:1.8.0_222] at sun.awt.FontConfiguration.init(FontConfiguration.java:107) ~[na:1.8.0_222] at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774) ~[na:1.8.0_222] at sun.font.SunFontManager$2.run(SunFontManager.java:431) ~[na:1.8.0_222] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_222] at sun.font.SunFontManager.(SunFontManager.java:376) ~[na:1.8.0_222]
at sun.awt.FcFontManager.(FcFontManager.java:35) ~[na:1.8.0_222]
at sun.awt.X11FontManager.(X11FontManager.java:57) ~[na:1.8.0_222]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_222]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_222]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_222]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_222]
at java.lang.Class.newInstance(Class.java:442) ~[na:1.8.0_222]
at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83) ~[na:1.8.0_222]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_222]
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) ~[na:1.8.0_222]
at java.awt.Font.getFont2D(Font.java:491) ~[na:1.8.0_222]
at java.awt.Font.canDisplayUpTo(Font.java:2060) ~[na:1.8.0_222]
at java.awt.font.TextLayout.singleFont(TextLayout.java:470) ~[na:1.8.0_222]
at java.awt.font.TextLayout.(TextLayout.java:531) ~[na:1.8.0_222]
at org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:273) ~[poi-4.1.0.jar!/:4.1.0]
at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.(AutoSizeColumnTracker.java:117) ~[poi-ooxml-4.1.0.jar!/:4.1.0]
at org.apache.poi.xssf.streaming.SXSSFSheet.(SXSSFSheet.java:82) ~[poi-ooxml-4.1.0.jar!/:4.1.0]
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:674) ~[poi-ooxml-4.1.0.jar!/:4.1.0]
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:695) ~[poi-ooxml-4.1.0.jar!/:4.1.0]
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:87) ~[poi-ooxml-4.1.0.jar!/:4.1.0]
at com.alibaba.excel.util.WorkBookUtil.createSheet(WorkBookUtil.java:57) ~[easyexcel-2.0.5.jar!/:na]
at com.alibaba.excel.context.WriteContextImpl.initSheet(WriteContextImpl.java:191) ~[easyexcel-2.0.5.jar!/:na]
at com.alibaba.excel.context.WriteContextImpl.currentSheet(WriteContextImpl.java:141) ~[easyexcel-2.0.5.jar!/:na]
at com.alibaba.excel.write.ExcelBuilderImpl.addContent(ExcelBuilderImpl.java:91) ~[easyexcel-2.0.5.jar!/:na]
at com.alibaba.excel.ExcelWriter.write(ExcelWriter.java:155) ~[easyexcel-2.0.5.jar!/:na]
at com.alibaba.excel.ExcelWriter.write(ExcelWriter.java:140) ~[easyexcel-2.0.5.jar!/:na]
at com.hcll.sail.file.consumer.controller.ExportController.exportMoMessage(ExportController.java:215) ~[classes!/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_222]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_222]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_222]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_222]
JDK version The output of
java -version
commandExecution environment centos 7