B4J Question AdditionalModuleInfoString

Arnaud

Active Member
Licensed User
Longtime User
Hello,

I need to add several AdditionalModuleInfoString in B4JPackager11.

B4X:
Private AdditionalModuleInfoString As String ="exports com.lynden.gmapsfx.javascript.event;"                                 '(for jGoolgeMap)
Private AdditionalModuleInfoString As String ="opens schemaorg_apache_xmlbeans.system.sD023D6490046BA0250A839A9AD24C443;"    '(for JPOI excel)'


How can I do it to add the both please?

Thanks
 

Arnaud

Active Member
Licensed User
Longtime User
Thanks,

I have writen this in my program

PackagerProperty:
#Region  Project Attributes
    #MainFormWidth: -1
    #MainFormHeight: -1
        
#End Region

#PackagerProperty: IncludedModules = jdk.charsets, javafx.web
#PackagerProperty: AdditionalModuleInfoString = opens schemaorg_apache_xmlbeans.system.sD023D6490046BA0250A839A9AD24C443;
#PackagerProperty: AdditionalModuleInfoString = exports com.lynden.gmapsfx.javascript.event;

But I have always an error when I test :

error:
Diagnostic XML Bean debug log file created: C:\Users\arnau\AppData\Local\Temp\xmlbeandebug5199943294505895821.log
org.apache.poi.ooxml.POIXMLException
        at b4j/org.apache.poi.ooxml.POIXMLFactory.createDocumentPart(Unknown Source)
        at b4j/org.apache.poi.ooxml.POIXMLDocumentPart.read(Unknown Source)
        at b4j/org.apache.poi.ooxml.POIXMLDocument.load(Unknown Source)
        at b4j/org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(Unknown Source)
        at b4j/org.apache.poi.xssf.usermodel.XSSFWorkbookFactory.createWorkbook(Unknown Source)
        at b4j/org.apache.poi.xssf.usermodel.XSSFWorkbookFactory.createWorkbook(Unknown Source)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at b4j/org.apache.poi.ss.usermodel.WorkbookFactory.createWorkbook(Unknown Source)
        at b4j/org.apache.poi.ss.usermodel.WorkbookFactory.createXSSFWorkbook(Unknown Source)
        at b4j/org.apache.poi.ss.usermodel.WorkbookFactory.create(Unknown Source)
        at b4j/anywheresoftware.b4j.objects.PoiWorkbookWrapper.InitializeExisting(Unknown Source)
        at b4j/anywheresoftware.b4j.objects.PoiWorkbookWrapper$1.call(Unknown Source)
        at b4j/anywheresoftware.b4j.objects.PoiWorkbookWrapper$1.call(Unknown Source)
        at b4j/anywheresoftware.b4a.BA$4.run(Unknown Source)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
        at b4j/org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(Unknown Source)
        ... 22 more
Caused by: java.lang.ExceptionInInitializerError
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unknown Source)
        at java.base/jdk.internal.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
        at java.base/jdk.internal.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
        at java.base/java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
        at java.base/java.lang.reflect.Field.getFieldAccessor(Unknown Source)
        at java.base/java.lang.reflect.Field.get(Unknown Source)
        at b4j/org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(Unknown Source)
        at b4j/org.openxmlformats.schemas.drawingml.x2006.main.ThemeDocument.<clinit>(Unknown Source)
        at b4j/org.openxmlformats.schemas.drawingml.x2006.main.ThemeDocument$Factory.parse(Unknown Source)
        at b4j/org.apache.poi.xssf.model.ThemesTable.<init>(Unknown Source)
        ... 27 more
Caused by: java.lang.RuntimeException: Could not instantiate SchemaTypeSystemImpl (java.lang.reflect.InvocationTargetException): is the version of xbean.jar correct?
        at b4j/schemaorg_apache_xmlbeans.system.sD023D6490046BA0250A839A9AD24C443.TypeSystemHolder.loadTypeSystem(Unknown Source)
        at b4j/schemaorg_apache_xmlbeans.system.sD023D6490046BA0250A839A9AD24C443.TypeSystemHolder.<clinit>(Unknown Source)
        ... 38 more
Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
        ... 40 more
Caused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled schema: Could not locate compiled schema resource schemaorg_apache_xmlbeans/system/sD023D6490046BA0250A839A9AD24C443/index.xsb (schemaorg_apache_xmlbeans.system.sD023D6490046BA0250A839A9AD24C443.index) - code 0
        at b4j/org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.<init>(Unknown Source)
        at b4j/org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(Unknown Source)
        at b4j/org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.<init>(Unknown Source)
        ... 44 more

Where is my mistake please?

Thanks
 
Upvote 0

Arnaud

Active Member
Licensed User
Longtime User
Hello,

If I inverse the both line as :

PackagerProperty:
#PackagerProperty: AdditionalModuleInfoString = exports com.lynden.gmapsfx.javascript.event;
#PackagerProperty: AdditionalModuleInfoString = opens schemaorg_apache_xmlbeans.system.sD023D6490046BA0250A839A9AD24C443;
#PackagerProperty: IncludedModules = jdk.charsets, javafx.web

The error switch and is now :

error:
Alert: loadMapLibrary
mapLibraryLoaded!
googlemapview._gmap_ready (java line: -1)
netscape.javascript.JSException: java.lang.IllegalAccessException: module javafx.web cannot access class com.lynden.gmapsfx.javascript.event.EventHandlers (in module b4j) because module b4j does not open com.lynden.gmapsfx.javascript.event to javafx.web
        at javafx.web/com.sun.webkit.dom.JSObject.fwkMakeException(Unknown Source)
        at javafx.web/com.sun.webkit.dom.JSObject.callImpl(Native Method)
        at javafx.web/com.sun.webkit.dom.JSObject.call(Unknown Source)
        at b4j/com.lynden.gmapsfx.javascript.JavascriptObject.invokeJavascript(Unknown Source)
        at b4j/com.lynden.gmapsfx.javascript.object.GoogleMap.internalSetZoom(Unknown Source)
        at b4j/com.lynden.gmapsfx.javascript.object.GoogleMap.lambda$1(Unknown Source)
        at javafx.base/com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(Unknown Source)
        at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
        at javafx.base/javafx.beans.property.IntegerPropertyBase.fireValueChangedEvent(Unknown Source)
        at javafx.base/javafx.beans.property.IntegerPropertyBase.markInvalid(Unknown Source)
        at javafx.base/javafx.beans.property.IntegerPropertyBase.set(Unknown Source)
        at b4j/com.lynden.gmapsfx.javascript.object.GoogleMap.setZoom(Unknown Source)
        at b4j/anywheresoftware.b4j.googlemaps.GoogleMapWrapper.MoveCamera(Unknown Source)
        at b4j/b4j.ALFANO6.googlemapview._gmap_ready(Unknown Source)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at b4j/anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
        at b4j/anywheresoftware.b4a.BA.raiseEvent(Unknown Source)
        at b4j/anywheresoftware.b4j.googlemaps.GoogleMapWrapper$1.mapInitialized(Unknown Source)
        at b4j/com.lynden.gmapsfx.GoogleMapView.fireMapInitializedListeners(Unknown Source)
        at b4j/com.lynden.gmapsfx.GoogleMapView$MapLibraryLoadBridge.mapLibraryLoaded(Unknown Source)
        at b4j/com.lynden.gmapsfx.GoogleMapView$1.handle(Unknown Source)
        at b4j/com.lynden.gmapsfx.GoogleMapView$1.handle(Unknown Source)
        at javafx.web/com.sun.javafx.webkit.UIClientImpl.lambda$dispatchWebEvent$1(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.web/com.sun.javafx.webkit.UIClientImpl.dispatchWebEvent(Unknown Source)
        at javafx.web/com.sun.javafx.webkit.UIClientImpl.alert(Unknown Source)
        at javafx.web/com.sun.webkit.WebPage.fwkAlert(Unknown Source)
        at javafx.web/com.sun.webkit.Timer.twkFireTimerEvent(Native Method)
        at javafx.web/com.sun.webkit.Timer.fireTimerEvent(Unknown Source)
        at javafx.web/com.sun.webkit.Timer.notifyTick(Unknown Source)
        at javafx.web/javafx.scene.web.WebEngine$PulseTimer.lambda$static$0(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalAccessException: module javafx.web cannot access class com.lynden.gmapsfx.javascript.event.EventHandlers (in module b4j) because module b4j does not open com.lynden.gmapsfx.javascript.event to javafx.web
        at javafx.web/com.sun.webkit.MethodHelper.invoke(Unknown Source)
        at javafx.web/com.sun.webkit.Utilities.lambda$fwkInvokeWithContext$0(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.web/com.sun.webkit.Utilities.fwkInvokeWithContext(Unknown Source)
        ... 40 more

Alert: !!!mapLibraryLoaded!!!

It seems that only the last line of Package Property is considered, not the first. Is it possible?
 
Upvote 0

Arnaud

Active Member
Licensed User
Longtime User
Hello,

I think I have found the error.

Please see this post :

 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…