Upgrade to Apachi POI X.X Java module compatibility is achieved.
See original GitHub issueSOLUTION: Upgrade Apache POI as soon as a version with Java modules is released. This will remove one more component from the Java 8 bridge.
- If this plays nice with being compiled to an image, pull its functionality from the Java 8 bridge
- If it does not play nice, update within the Java 8 bridge and test J9+ compatibility at the console
ORIGINAL USER TEXT:
Hi,
When attempting to export a language to excel, PolyGlot reports that the java runtime is missing.
However, upon further investigation, this does not seem to be the case. I did some digging, and it appears that the core of the issue is actually an unsupported character set (Big5). When running polyglot from command line, I had a look at the commands it was invoking, namely:
java --version
and
java -jar .../PolyGlot_J8_Bridge.jar export-to-excel ... etc
The version check actually seems to pass, which makes sense given that JRE 1.8 is installed and configured in the path correctly. The command that seems to fail is the second one, which appears to be caught by the same exception handler and reported as a runtime issue.
To further debug this, and provide more information, I ran the command myself, and it produced the following output:
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.apache.poi.hssf.record.WriteAccessRecord.setUsername(WriteAccessRecord.java:98)
at org.apache.poi.hssf.record.WriteAccessRecord.<init>(WriteAccessRecord.java:48)
at org.apache.poi.hssf.model.InternalWorkbook.createWriteAccess(InternalWorkbook.java:1148)
at org.apache.poi.hssf.model.InternalWorkbook.createWorkbook(InternalWorkbook.java:381)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:220)
at PolyGlot.ExcelExport.<init>(ExcelExport.java:55)
at PolyGlot.ExcelExport.exportExcelDict(ExcelExport.java:85)
at PolyGlot.PolyGlot.exportToExcel(PolyGlot.java:138)
at PolyGlot.PolyGlot.main(PolyGlot.java:58)
Caused by: java.nio.charset.UnsupportedCharsetException: Big5
at java.base/java.nio.charset.Charset.forName(Charset.java:529)
at org.apache.poi.util.StringUtil.<clinit>(StringUtil.java:39)
... 9 more
This seems to be the actual of the issue. However, just in case it’s useful, here is the error log generated by PolyGlot:
java.version : 12.0.2
java.vendor : Oracle Corporation
java.vendor.url : https://java.oracle.com/
java.vm.specification.version : 12
java.vm.specification.name : Java Virtual Machine Specification
java.vm.version : 12.0.2+10
java.vm.vendor : Oracle Corporation
java.vm.name : Java HotSpot(TM) 64-Bit Server VM
java.specification.version : 12
java.specification.vendor : Oracle Corporation
java.specification.name : Java Platform API Specification
java.class.version : 56.0
java.ext.dirs : null
os.name : Windows 10
os.arch : amd64
os.version : 10.0
2019/11/29 22:44:44-Unable to export to excel: File not found post export.-java.io.IOException
java.io.IOException: Unable to export to excel: File not found post export.
at org.darisadesigns.polyglotlina.polyglot@3.0/org.darisadesigns.polyglotlina.Java8Bridge.exportExcelDict(Java8Bridge.java:153)
at org.darisadesigns.polyglotlina.polyglot@3.0/org.darisadesigns.polyglotlina.Screens.ScrMainMenu.exportToExcel(ScrMainMenu.java:671)
at org.darisadesigns.polyglotlina.polyglot@3.0/org.darisadesigns.polyglotlina.Screens.ScrMainMenu.mnuExportToExcelActionPerformed(ScrMainMenu.java:1724)
at org.darisadesigns.polyglotlina.polyglot@3.0/org.darisadesigns.polyglotlina.Screens.ScrMainMenu$25.actionPerformed(ScrMainMenu.java:1528)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:369)
at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1020)
at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1064)
at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6632)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
at java.desktop/java.awt.Component.processEvent(Component.java:6397)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2762)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Please let me know if you need any more information.
Thanks,
Mika
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
Thank you for the wealth of details here! I will try to take a look at this tomorrow and let you know whether I need any assistance reproducing it.
SuperCSV 2.5 looks like it will be dropping soon. The next release of PolyGlot is being held on this…