B4J Question [SOLVED] Crash in Release mode java11

micro

Well-Known Member
Licensed User
Longtime User
Hi to all
i have a simply layout
1679030849384.png

tv is a TableView
txtsearch is a jbtflotaing_search (Custom view of the jdashboardUI library)
btcaricatrovati is a SwiftButton
in debug mode everything works but in release when I call the sub that loads that layout it crashes
Sub:
Sub SetTableFor(tabella As String)
    Dim dialog As B4XDialog
    dialog = Main.SetDialog(dialog)
    dialog.Title="Ricerca in archivio " & tabella
    Dim p As B4XView = xui.CreatePanel("")
    p.Height=450
    p.Width=600
    p.LoadLayout("tvcerca")'< crash
    Log("1")
    tv_color.sky_blue(tv)
    txtsearch.SetIcon(xui.CreateFontAwesome(15), Chr(0xf002))
    Log("1")
    Select tabella
        Case "TA"
            LoadA("")
            tv.Tag="1"
        Case "TB"
            LoadB("")
            tv.tag="2"
    End Select
    Dim rs As ResumableSub = dialog.ShowCustom(p, "", "", "Esci")
    Wait For (rs) Complete (Result As Int)
End Sub

This is the Error (it would appear on the redraw of the swiftbutton)
Error:
addriuso$ResumableSub_SetTableFor.resume (java line: 1847)
java.lang.RuntimeException: java.lang.IllegalAccessError: class anywheresoftware.b4a.objects.B4XCanvas$B4XPath (in unnamed module @0x5f675645) cannot access class com.sun.javafx.geom.Path2D (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.geom to unnamed module @0x5f675645
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:140)
    at anywheresoftware.b4j.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:85)
    at anywheresoftware.b4j.objects.LayoutBuilder.loadLayout(LayoutBuilder.java:109)
    at anywheresoftware.b4j.objects.PaneWrapper.LoadLayout(PaneWrapper.java:101)
    at anywheresoftware.b4a.objects.B4XViewWrapper.LoadLayout(B4XViewWrapper.java:508)
    at b4j.example.addriuso$ResumableSub_SetTableFor.resume(addriuso.java:1847)
    at b4j.example.addriuso._settablefor(addriuso.java:1804)
    at b4j.example.addriuso._btconfarc_click(addriuso.java:494)
    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:111)
    at anywheresoftware.b4a.BA$1.run(BA.java:236)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalAccessError: class anywheresoftware.b4a.objects.B4XCanvas$B4XPath (in unnamed module @0x5f675645) cannot access class com.sun.javafx.geom.Path2D (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.geom to unnamed module @0x5f675645
    at anywheresoftware.b4a.objects.B4XCanvas$B4XPath.InitializeRoundedRect(B4XCanvas.java:379)
    at b4j.example.swiftbutton._draw(swiftbutton.java:179)
    at b4j.example.swiftbutton._base_resize(swiftbutton.java:78)
    at b4j.example.swiftbutton._designercreateview(swiftbutton.java:157)
    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:111)
    ... 20 more
I don't use package creation from ide but agrham mode (exe file created with basi4ppc), for convenience when I have to edit code often
in the args file i put:
B4X:
--add-opens javafx.controls/com.sun.javafx.scene.control.skin=ALL-UNNAMED --module-path c:\java\jdk-11.0.1\javafx\lib --add-modules javafx.controls,javafx.web
but to no avail. (probably missing some arguments to add)

Thanks to all
 
Last edited:

micro

Well-Known Member
Licensed User
Longtime User
I use @agraham 's tool too that way; my args file looks like (notice the empty first line):
B4X:
(this line is empty)
@release_java_modules.txt

File release_java_modules.txt is in the same directory as the args, exe, and jar files, and is copied from the B4J installation directory, e.g. C:\Program Files\Anywhere Software\B4J
Perfect, works fine.
 
Upvote 0
Top