B4J Question Packager 11 and JPOI

Peter Meares

Member
Licensed User
Longtime User
I have just moved to Java11 and I seem to have a problem with Packager 11 and Excel.

Under Java 11 the program runs nicely in release mode and Run (F5) on first compile, but not on re-running the jar file.
So I then tried Packager 11 to make a release file that I could move to my day to day folder.
The Packager 11 sems to compile properly and the exe file does run but when I ask the program to load the files (CSV and one Excel) the Excel file crashes it.
I see in Erel's notes one must add:
B4X:
#PackagerProperty: AdditionalModuleInfoString = opens schemaorg_apache_xmlbeans.system.sD023D6490046BA0250A839A9AD24C443;
#PackagerProperty: IncludedModules = jdk.charsets
but this leads to a compile error.

main._appstart (java line: 43)
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (List).
at anywheresoftware.b4a.keywords.Common$2$1.run(Common.java:1037)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:47)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:43)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:170)
at b4j.packager.main._appstart(main.java:43)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
at b4j.packager.main.main(main.java:28)
Caused by: java.lang.RuntimeException: Object should first be initialized (List).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:49)
at anywheresoftware.b4a.objects.collections.List.getSize(List.java:134)
at b4j.packager.packager._deletefolderrecursive(packager.java:571)
at b4j.packager.packager$ResumableSub_PrepareFolders.resume(packager.java:1449)
at anywheresoftware.b4a.keywords.Common$2$1.run(Common.java:1035)
... 11 more

Any ideas?
 

Peter Meares

Member
Licensed User
Longtime User
I cleaned out the old jpoi files and made sure jpoi 5 files existed.
I also set up the B4J Java 11 folder again.

The excel file now reads from the Packager folder .exe file, but I do notice that it requires the XLUtils library even though I make no reference to it. I only use the jpoi functions (as before) after updating the poi.InitializeExisting function call.
Deselecting the XLUtils Library in the IDE causes the excel file read to fail.

I might find time to build a small example to see if I can repeat it outside my larger program.

I run all the files from my local Dropbox account folder. This has never been a problem so far.
 
Upvote 0
Top