B4J Question [BANanoServer] StartServerHTTP2 Issue Revisited

LJG

Member
I posted this issue in an old post but I never was able to resolve it.

I've been trying to get StartServerHTTP2 SSL to work in a localhost environment but with no success. I created the keystore.jks file with no problem ... but when I try to run it, I get the BANanoServer console error below (in Debug mode). Maybe I am putting the keystore.jks file in the wrong place? I don't know. I know that some have been successful using SSL in BANanoServer locally ... but, for some reason, it has been a nightmare for me. Thanks for your help.

Here is the full BANanoServer side debugging log with the error:

BANanoServer Console Output (Debug Mode):
Waiting for debugger to connect...
Program started.
(MyMap) {DriverClass=com.mysql.cj.jdbc.Driver, AppTitle=TestApp, SessionMaxInactiveIntervalSeconds=60, User=root, Port=55056, MaxPoolSize=100, sql.select_animal=SELECT name, image, id FROM animals WHERE id = ?;, AppName=TestApp, JdbcUrl=jdbc:mysql://localhost/test?characterEncoding=utf8, DBuseSSL=false, Database=test, SHAREDPrefix=SHARED, UploadMaxSize=5242880, sql.create_animal_table=CREATE TABLE IF NOT EXISTS animals (id INTEGER PRIMARY KEY AUTO_INCREMENT,name CHAR(30) NOT NULL,image BLOB), sql.select_animal_names=SELECT name FROM animals;, Password=, Host=localhost, BROWSERPrefix=BROWSER, DbPort=3306, UploadAllowedFileTypes=ZIP;JPG, sql.create_article_table=CREATE TABLE IF NOT EXISTS article (col1 numeric(10,4), col2 text);, PortSSL=55057, DBServer=localhost, StartPage=index, sql.insert_article=INSERT INTO article VALUES(?, ?), Jdbc=jdbc:mysql, CacheScavengePeriodSeconds=30, characterEncoding=utf8, ServerPort=17120, sql.insert_animal=INSERT...
------------------------------
Server Host: localhost
Server Port: 55056
Server SSL Port: 55057
------------------------------
Reading B4J INI in C:\Users\DT911\AppData\Roaming\Anywhere Software\B4J to find Additional Libraries folder...
Found Additional Libraries folder: C:\Program Files (x86)\Anywhere Software\B4J\AdditionalLibraries
Starting to transpile...
Loading layout baselayout...
Loading layout dialogfill_input_login...
Loading layout dialogfill_input_login2...
Loading layout login...
Loading layout masterdialog_input...
Loading layout rats...
Processing b4xlib: jsql
Processing b4xlib: jstringutils
Processing b4xlib: bananofontawesome
Processing b4xlib: bananovuetifyad3
Processing b4xlib: bananoanimejs
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method CallInlinePHPWait will not work in old browsers!
[WARNING]: The method CallInlinePHPWait will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method ThenWait will not work in old browsers!
[WARNING]: The method ElseWait will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method CallAjaxWait will not work in old browsers!
[WARNING]: The method AddEventlistenerOpenAsync will not work in old browsers!
[WARNING]: The method ThenWait will not work in old browsers!
[WARNING]: The method ElseWait will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method ThenWait will not work in old browsers!
[WARNING]: The method ElseWait will not work in old browsers!
[WARNING]: The method ThenWait will not work in old browsers!
[WARNING]: The method ElseWait will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
Adding Layout baselayout used by browserindex
Adding Layout login used by viewlogin
Adding Layout masterdialog_input used by viewlogin2
Adding Layout dialogfill_input_login used by viewlogin2
Adding Layout rats used by viewrats
Building C:\Users\DT911\DOCUME~1\B4J PROJECTS\DW911_ServerClient_10\BVAD3Server\Objects\www\scripts\browserindex.js
[WARNING]: The method showswalinputwait will not work in old browsers!
[WARNING]: The method showswalconfirmwait will not work in old browsers!
[WARNING]: The method uploadfilewait will not work in old browsers!
[WARNING]: The method buildgeojson will not work in old browsers!
[WARNING]: The method showswalinputwait will not work in old browsers!
[WARNING]: The method showswalconfirmwait will not work in old browsers!
[WARNING]: The method uploadfilewait will not work in old browsers!
[WARNING]: The method buildgeojson will not work in old browsers!
Copying CSS files to WebApp assets...
Copying Javascript files to WebApp assets...
Done!
2021-07-09 14:32:38.598:INFO::main: Logging initialized @32777ms to org.eclipse.jetty.util.log.StdErrLog
Error occurred on line: 735 (BANanoServer)
java.lang.ClassNotFoundException: b4j.bvad3bananoserver.true
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:315)
    at anywheresoftware.b4j.object.ServerWrapper.Start(ServerWrapper.java:181)
    at b4j.bvad3bananoserver.bananoserver._startserverhttp2(bananoserver.java:717)
    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.shell.Shell.runMethod(Shell.java:632)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    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.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
    at b4j.bvad3bananoserver.main.main(main.java:29)
 

LJG

Member
I tried using ABKeyStore SSL (in self-cert mode) to see if that would make a difference.

ABKeystore creates the local self-cert jks file (in the Objects folder for dev) and a range times file in the KeyVault folder ... but still no success in running BANanoServer on localhost in HTTPS mode via StartServerHTTP2.

By the way, I am using a Win10 64 Bit using OpenJDK 11 + OpenJFX 11.

Below is the B4J Console error that I get using ABKeyStore:

B4J Console:
Starting server in HTTPS mode...
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Error occurred on line: 735 (BANanoServer)
java.lang.ClassNotFoundException: b4j.bvad3bananoserver.true
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:315)
    at anywheresoftware.b4j.object.ServerWrapper.Start(ServerWrapper.java:181)
    at b4j.bvad3bananoserver.bananoserver._startserverhttp2(bananoserver.java:812)
    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.shell.Shell.runMethod(Shell.java:632)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    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.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
    at b4j.bvad3bananoserver.main.main(main.java:29)

Please help so that we can properly locally develop and debug our HTTPS (PWA) based BANAnoServer projects.
 
Upvote 0

LJG

Member
This is what I get trying to run it with Oracle JDK 8 in a Win10 32 bit machine (instead of OpenJDK 11 + OpenJFX 11):

B4j Console:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Error occurred on line: 735 (BANanoServer)
java.lang.IllegalStateException: No Server ALPNProcessors!
    at org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory.<init>(ALPNServerConnectionFactory.java:53)
    at anywheresoftware.b4j.object.ServerWrapper.Start(ServerWrapper.java:142)
    at b4j.bvad3bananoserver.bananoserver._startserverhttp2(bananoserver.java:812)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
    at b4j.bvad3bananoserver.main.main(main.java:29)
    Suppressed: java.util.ServiceConfigurationError: org.eclipse.jetty.io.ssl.ALPNProcessor$Server: Provider org.eclipse.jetty.alpn.conscrypt.server.ConscryptServerALPNProcessor could not be instantiated
        at java.util.ServiceLoader.fail(ServiceLoader.java:232)
        at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
        at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
        at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
        at org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory.<init>(ALPNServerConnectionFactory.java:60)
        ... 17 more
    Caused by: java.lang.NoClassDefFoundError: org/conscrypt/OpenSSLProvider
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
        at java.lang.Class.getConstructor0(Class.java:3075)
        at java.lang.Class.newInstance(Class.java:412)
        at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
        ... 20 more
    Caused by: java.lang.ClassNotFoundException: org.conscrypt.OpenSSLProvider
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        ... 25 more
    Suppressed: java.lang.UnsupportedClassVersionError: org/eclipse/jetty/alpn/java/server/JDK9ServerALPNProcessor has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
        at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
        at org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory.<init>(ALPNServerConnectionFactory.java:60)
        ... 17 more
 
Upvote 0

LJG

Member
I tested a keystore.jks file in a plain B4J jServer (nonBANanoServer) project on a Win10/64Bit/OpenJDK 11+OpenJFX 11 machine ... and that compiles and works with no problem:

B4J jServer:
Private Sub ConfigureSSL (SslPort As Int)
    'example of SSL connector configuration
    Dim ssl As SslConfiguration
    ssl.Initialize
    ssl.SetKeyStorePath(File.DirApp, "keystore.jks") 'path to keystore file
    ssl.KeyStorePassword = "123456"
    ssl.KeyManagerPassword = "123456"
    srvr.SetSslConfiguration(ssl, SslPort)
    'add filter to redirect all traffic from http to https (optional)
    'srvr.AddFilter("/*", "HttpsFilter", False)
End Sub

So, the issues mentioned above seem to be isolated to BANanoServer. Hopefully, someone can help resolve this issue, thank you.
 
Upvote 0

LJG

Member
 
Upvote 0
Top