question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrade to Apachi POI X.X Java module compatibility is achieved.

See original GitHub issue

SOLUTION: Upgrade Apache POI as soon as a version with Java modules is released. This will remove one more component from the Java 8 bridge.

  1. If this plays nice with being compiled to an image, pull its functionality from the Java 8 bridge
  2. 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:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
DraqueTcommented, Nov 30, 2019

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.

0reactions
DraqueTcommented, Feb 5, 2020

SuperCSV 2.5 looks like it will be dropping soon. The next release of PolyGlot is being held on this…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Asked Questions - Apache POI
The OOXML support in Apache POI is built on top of the file format XML Schemas, as compiled into Java using XMLBeans. Currently,...
Read more >
Eclipse is confused by imports ("accessible from more than ...
I've found some interesting behaviour with Java 11 and the xmlbeans library. The xmlbeans library is a transitive dependency of Apache POI, a ......
Read more >
Transition from Java 8 to Java 11 - Azure - Microsoft Learn
Once the application runs on Java 11, consider moving libraries off the class-path and onto the module-path. Look for updated versions of the ......
Read more >
Apache POI compatibility 3.17 vs 4 - SmartClient Forums
Hello, we just updated some of our system dependencies, specifically we went from POI 3.17 to POI 4 and the Excel export function...
Read more >
Migrating From JDK 8 to Later JDK Releases
The modularization of the Java SE Platform that happened in JDK 9 and later brought many benefits, but also many changes. Code that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found