B4J Question Error after building standalone package (httpJob)

mediakon

New Member
Licensed User
Longtime User
When I build an application in debug or release mode it works without any problems and connects to the server via the jOkHttpUtils2 library (2.92).

When I build an application as a "Standalone Package" the application does not enter the part of the code responsible for downloading json from the server.

Example

Example:
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download("url to my server")
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        Dim parser As JSONParser
        parser.Initialize(j.GetString)
        Dim root As List = parser.NextArray
        For Each colroot As Map In root
            If colroot.Get("results")<>Null Then
                If colroot.Get("results")="fail" Then
                    xui.MsgboxAsync("Podaj prawidłowy kod logowania lub listy","Logowanie")
                    Exit
                End If
                If colroot.Get("results")="norecords" Then
                    xui.MsgboxAsync("Brak zadań dla wybranej listy","Uwaga")
                    Exit
                End If
            End If
            board.Show
            Exit
        Next
    
    End If
    j.Release

I read the post https://www.b4x.com/android/forum/t...-way-to-distribute-standalone-ui-apps.117880/.
Unfortunately I did not find anything about it and adding packages ends up being a problem.
 

mediakon

New Member
Licensed User
Longtime User
C:\Users\Piotr\OneDrive\lno\wemos_b4j\Objects\temp\build>cd bin

C:\Users\Piotr\OneDrive\lno\wemos_b4j\Objects\temp\build\bin>java.exe @release_java_modules.txt -m b4j/b4j.example.main
(Button) Button@7f8b7ae3[styleClass=button]'1'
1
(Button) Button@39fa05c3[styleClass=button]'2'
(Button) Button@4fc62db9[styleClass=button]'3'
(Button) Button@7cff2b72[styleClass=button]'4'
(Button) Button@58071a6c[styleClass=button]'5'
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.Alert$AlertConsumer.consume(Unknown Source)
at java.base/sun.security.ssl.TransportContext.dispatch(Unknown Source)
at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
at java.base/sun.security.ssl.SSLSocketImpl.decode(Unknown Source)
at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(Unknown Source)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at b4j/okhttp3.internal.connection.RealConnection.connectTls(Unknown Source)
at b4j/okhttp3.internal.connection.RealConnection.establishProtocol(Unknown Source)
at b4j/okhttp3.internal.connection.RealConnection.buildConnection(Unknown Source)
at b4j/okhttp3.internal.connection.RealConnection.connect(Unknown Source)
at b4j/okhttp3.internal.connection.StreamAllocation.findConnection(Unknown Source)
at b4j/okhttp3.internal.connection.StreamAllocation.findHealthyConnection(Unknown Source)
at b4j/okhttp3.internal.connection.StreamAllocation.newStream(Unknown Source)
at b4j/okhttp3.internal.connection.ConnectInterceptor.intercept(Unknown Source)
at b4j/okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at b4j/okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at b4j/okhttp3.internal.cache.CacheInterceptor.intercept(Unknown Source)
at b4j/okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at b4j/okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at b4j/okhttp3.internal.http.BridgeInterceptor.intercept(Unknown Source)
at b4j/okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at b4j/okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(Unknown Source)
at b4j/okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at b4j/okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source)
at b4j/okhttp3.RealCall.getResponseWithInterceptorChain(Unknown Source)
at b4j/okhttp3.RealCall.execute(Unknown Source)
at b4j/anywheresoftware.b4h.okhttp.OkHttpClientWrapper.executeWithTimeout(Unknown Source)
at b4j/anywheresoftware.b4h.okhttp.OkHttpClientWrapper.access$0(Unknown Source)
at b4j/anywheresoftware.b4h.okhttp.OkHttpClientWrapper$ExecuteHelper.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)
Suppressed: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
... 37 more
ResponseError. Reason: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure, Response:
 
Upvote 0

mediakon

New Member
Licensed User
Longtime User
Did you add

B4X:
#PackagerProperty: IncludedModules = jdk.crypto.ec
?

KMatle thanks now works well.

Before I added the post I inserted your line and had a problem. I was on another internet connection and another machine. It is possible that something was blocking communication. Anyway, the App that started directly from B4J was working properly both in release and debug mode.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…