B4J Question [SOLVED] Can't load contents in a webview in a .exe from an ssl website.

valentino s

Active Member
Licensed User
Longtime User
I have a test application: a window with a button and a webview.

I click on the buttom to browse an url (https:)

It works with project-compile and execute.
In "build a standalone project" b4j 8.50 creates successfully the .exe but the webview can't load the page (firewall disabled)
I use openjdk 11.0.1

The only warning I've found is this one: https://www.b4x.com/android/forum/t...ion-no-psk-available-unable-to-resume.115263/

Any idea ?

UPDATE:
1) this is the source code, sorry for the stupid name "testlenovo".
2) glasswire ( a software to monitor internet accesses) informs me that the app "goes online".
3) looking for help on forums it seems an issuee on supporting TLS v1.3. In january 2020 "Adam" in https://stackoverflow.com/questions...slexception-no-psk-available-unable-to-resume suggested 3 solutions:
  • wait for the release of JDK 12
  • or for a backport to JDK 11
  • or use this command line parameter as a workaround: -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2
I don't know how to implement it on b4j.
 

Attachments

  • testlenovo.zip
    3 KB · Views: 234
Last edited:

valentino s

Active Member
Licensed User
Longtime User
Thanks.
Even clicking on the button, nothing more than:

xxxxx\Developer\b4jexamples\testlenovo\testlenovo\B4J\Objects\temp\build>cd bin
xxxxx\Developer\b4jexamples\testlenovo\testlenovo\B4J\Objects\temp\build\bin>java.exe @release_java_modules.txt -m b4j/b4j.example.main

ps: I've found C:\xxxx\AppData\Local\Microsoft\CLR_v4.0\UsageLogs\testlenovo.exe.log

1,"fusion","GAC",0
1,"WinRT","NotApp",1
3,"System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","C:\WINDOWS\assembly\NativeImages_v4.0.30319_64\System\ded0489c10175ac76b2e1eb72027b058\System.ni.dll",0
 

Attachments

  • 2020-08-31_103333.jpg
    2020-08-31_103333.jpg
    105.7 KB · Views: 212
Last edited:
Upvote 0

valentino s

Active Member
Licensed User
Longtime User
Update

I know that if an answer does't come, is because a question is very similar to others.

So I've searched more and found:

- https://www.b4x.com/android/forum/t...-way-to-distribute-standalone-ui-apps.117880/

tips 2 and 7. (NO !!! DON'T DO IT: see tip 6 and solution at the bottom of this thread).

ERROR:
B4X:
#PackagerProperty: IncludedModules = javafx.web
#PackagerProperty: IncludedModules = jdk.crypto.ec

Now if I add the second line the .exe si produced, but if I run the app the window opens, and immediatly closes itself.

Running run_debug.bat


b4xmainpage.innerInitialize (java line: -1)
java.lang.RuntimeException: java.lang.NoClassDefFoundError: javafx/scene/web/WebView
at b4j/anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
at b4j/b4j.example.b4xmainpage.innerInitialize(Unknown Source)
at b4j/b4j.example.b4xmainpage._initialize(Unknown Source)
at b4j/b4j.example.b4xpagesmanager._initialize(Unknown Source)
at b4j/b4j.example.main._appstart(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/b4j.example.main.start(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(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.NoClassDefFoundError: javafx/scene/web/WebView
at b4j/anywheresoftware.b4j.objects.WebViewWrapper.<clinit>(Unknown Source)
at b4j/b4j.example.b4xmainpage._class_globals(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)
... 21 more
Caused by: java.lang.ClassNotFoundException: javafx.scene.web.WebView
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 27 more



So I will search for NoClassDefFoundError: javafx/scene/web/WebView because it is installed on my pc. I'll report you all my errors.

UPDATE:

If I use only #PackagerProperty: IncludedModules = javafx.web, the app doesn't self close, no errors, but I can't see the page.
If I use also #PackagerProperty: IncludedModules = jdk.crypto.ec the app do self close after start, and the error is ... webview missing: NoClassDefFoundError: javafx/scene/web/WebView
 
Last edited:
Upvote 0

valentino s

Active Member
Licensed User
Longtime User
So after some test, the issue isn't solved:

- the app loads a page in a webview after a click. F5 (compile and execute) works perfectly
- I add #PackagerProperty: IncludedModules = javafx.web
- If the site is not ssl: http://www.privacykitstore.it tip 2 works; if it is https: webview doesnt' load
- I add #PackagerProperty: IncludedModules = jdk.crypto.ec and run with debug, logs report: NoClassDefFoundError: javafx/scene/web/WebView either with http;// or https;//

It seems that If I support ssl, I loose webview support.
 
Upvote 0

valentino s

Active Member
Licensed User
Longtime User
SOLVED
A comma ..., reading tips 2,6,7 here

Use in main:
B4X:
#PackagerProperty: IncludedModules = javafx.web, jdk.crypto.ec

MY ERROR: NEVER use 2 keys #PackagerProperty: IncludedModules (tip 6)
NOTE: doesn't test on self signed ssl keys. test ssl on Google.
 
Upvote 0
Top