[jira] [Commented] (SOLR-10228) XLSXWriter fails on headless jvm due to missing awt fonts - causes errors in TestXLSXResponseWriter
[ https://issues.apache.org/jira/browse/SOLR-10228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15895844#comment-15895844 ] Jan Høydahl commented on SOLR-10228: +1 to disable feature and tests if we lost our head :) > XLSXWriter fails on headless jvm due to missing awt fonts - causes errors in > TestXLSXResponseWriter > > > Key: SOLR-10228 > URL: https://issues.apache.org/jira/browse/SOLR-10228 > Project: Solr > Issue Type: Bug > Security Level: Public(Default Security Level. Issues are Public) > Components: contrib - Solr Cell (Tika extraction) > Environment: debian openjdk-9-jdk-headless b158 >Reporter: Hoss Man > Labels: Java9 > > I found this while trying to setup some automated testing against JDK9, but i > suspect it would affect anyone using any "headless" of java... > {noformat} >[junit4] Tests with failures [seed: C8331E32DDBEC2E6]: >[junit4] - > org.apache.solr.handler.extraction.TestXLSXResponseWriter.testStructuredDataViaBaseWriters >[junit4] - > org.apache.solr.handler.extraction.TestXLSXResponseWriter.testPseudoFields > {noformat} > The root problems appear to be NPEs resulting from AWT Font classes not being > available when XLSXWriter tries to initialize POI ... which bubbles up to the > test as a java.lang.InternalError (full sack traces to follow in a comment) -- This message was sent by Atlassian JIRA (v6.3.15#6346) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-10228) XLSXWriter fails on headless jvm due to missing awt fonts - causes errors in TestXLSXResponseWriter
[ https://issues.apache.org/jira/browse/SOLR-10228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15895344#comment-15895344 ] Hoss Man commented on SOLR-10228: - We can probably work around this in the test with an assume -- but the correct fix is probably for XLSXWriter to fail to init if it can't be used -- perhaps using {{java.awt.GraphicsEnvironment.isHeadless()}} ? {noformat} [junit4] 2> NOTE: reproduce with: ant test -Dtestcase=TestXLSXResponseWriter -Dtests.method=testStructuredDataViaBaseWriters -Dtests.seed=C8331E32DDBEC2E6 -Dtests.slow=true -Dtests.locale=ro -Dtests.timezone=America/Kentucky/Monticello -Dtests.asserts=true -Dtests.file.encoding=UTF-8 [junit4] ERROR 1.07s J0 | TestXLSXResponseWriter.testStructuredDataViaBaseWriters <<< [junit4]> Throwable #1: java.lang.InternalError: java.lang.reflect.InvocationTargetException [junit4]>at __randomizedtesting.SeedInfo.seed([C8331E32DDBEC2E6:B964176DC21A5BD9]:0) [junit4]>at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:86) [junit4]>at java.base/java.security.AccessController.doPrivileged(Native Method) [junit4]>at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) [junit4]>at java.desktop/java.awt.Font.getFont2D(Font.java:495) [junit4]>at java.desktop/java.awt.Font.canDisplayUpTo(Font.java:2244) [junit4]>at java.desktop/java.awt.font.TextLayout.singleFont(TextLayout.java:469) [junit4]>at java.desktop/java.awt.font.TextLayout.(TextLayout.java:530) [junit4]>at org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:254) [junit4]>at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.(AutoSizeColumnTracker.java:117) [junit4]>at org.apache.poi.xssf.streaming.SXSSFSheet.(SXSSFSheet.java:77) [junit4]>at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:653) [junit4]>at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:646) [junit4]>at org.apache.solr.handler.extraction.XLSXWriter$SerialWriteWorkbook.(XLSXResponseWriter.java:112) [junit4]>at org.apache.solr.handler.extraction.XLSXWriter.(XLSXResponseWriter.java:165) [junit4]>at org.apache.solr.handler.extraction.XLSXResponseWriter.write(XLSXResponseWriter.java:66) [junit4]>at org.apache.solr.handler.extraction.TestXLSXResponseWriter.getWSResultForQuery(TestXLSXResponseWriter.java:237) [junit4]>at org.apache.solr.handler.extraction.TestXLSXResponseWriter.getWSResultForQuery(TestXLSXResponseWriter.java:232) [junit4]>at org.apache.solr.handler.extraction.TestXLSXResponseWriter.testStructuredDataViaBaseWriters(TestXLSXResponseWriter.java:89) [junit4]>at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [junit4]>at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [junit4]>at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [junit4]>at java.base/java.lang.reflect.Method.invoke(Method.java:547) [junit4]>at java.base/java.lang.Thread.run(Thread.java:844) [junit4]> Caused by: java.lang.reflect.InvocationTargetException [junit4]>at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [junit4]>at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [junit4]>at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [junit4]>at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:473) [junit4]>at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:84) [junit4]>... 55 more [junit4]> Caused by: java.lang.NullPointerException [junit4]>at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1288) [junit4]>at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225) [junit4]>at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107) [junit4]>at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:765) [junit4]>at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:440) [junit4]>at java.base/java.security.AccessController.doPrivileged(Native Method) [junit4]>at