B4J Question failed to start jServer as executable over SSL

hookshy

Well-Known Member
Licensed User
Longtime User
HI,
I have run a JServer test over http and packed as exe file and it works !
I have added SSL and start the server from b4j console and works !

When i start same SSL project form the executable i get the errors below !

Why the code works when run from b4j IDE and if run the executable it fails ?
options for Jserver does not have any users ? how do i fix this ...it looks like the certificat is asking for other parameters when initialising the SSL or my certificat is not well build , but again
it works from the IDE.

Please advise, Thank you .

error from console
B4X:
main._configuressl (java line: -1)
java.util.ServiceConfigurationError: org.eclipse.jetty.util.security.CredentialProvider: [B]module b4j does not declare `uses`[/B]
        at java.base/java.util.ServiceLoader.fail(Unknown Source)
        at java.base/java.util.ServiceLoader.checkCaller(Unknown Source)
        at java.base/java.util.ServiceLoader.<init>(Unknown Source)
        at java.base/java.util.ServiceLoader.load(Unknown Source)
        at b4j/org.eclipse.jetty.util.security.Credential.<clinit>(Unknown Source)
        at b4j/org.eclipse.jetty.util.ssl.SslContextFactory.newPassword(Unknown Source)
        at b4j/org.eclipse.jetty.util.ssl.SslContextFactory.setKeyStorePassword(Unknown Source)
        at b4j/anywheresoftware.b4j.object.ServerWrapper$SslContextFactoryWrapper.setKeyStorePassword(Unknown Source)
        at b4j/b4j.example.main._configuressl(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.main(Unknown Source)



code used in IDE
B4X:
Sub AppStart (Args() As String)
    srvr.Initialize("srvr")
    'srvr.AddFilter("/*", "AuthFilter", False)
    srvr.AddHandler("/getinfo", "InfoHandler", False)
'    srvr.Port = "4000"
    ConfigureSSL(4000)
    srvr.Start

    StartMessageLoop
End Sub

'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
    Return True
End Sub

Private Sub ConfigureSSL (SslPort As Int)
    'example of SSL connector configuration
    Dim ssl As SslConfiguration
    ssl.Initialize
    ssl.SetKeyStorePath(File.DirApp, "root.jks") 'path to keystore file
    ssl.KeyStorePassword = "xxxx"
    ssl.KeyManagerPassword = "xxxx"
   
    srvr.SetSslConfiguration(ssl, SslPort)

    'add filter to redirect all traffic from http to https (optional)
    'srvr.AddFilter("/*", "HttpsFilter", False)
End Sub
 

hookshy

Well-Known Member
Licensed User
Longtime User
B4X:
    If File.Exists(TempFolder, ReplaceSlashes("META-INF\services")) Then
       For Each f As String In File.ListFiles(File.Combine(TempFolder, ReplaceSlashes("META-INF\services")))
           sb.Append("uses ").Append(f).Append(";").Append(CRLF)
       Next
   End If

Hi,
Where do i put this code in my project ...it seems i have no TempFolder and no RepalceSlashes

Is this related to my error ?

B4X:
java.util.ServiceConfigurationError: org.eclipse.jetty.util.security.CredentialProvider: [B]module b4j does not declare `uses`[/B]
 
Upvote 0
Top