Good morning team,
Everything was working fine until i uploaded realeased jserver to VPS (fresh install). jServer was starting normally and webapp was visible but connection to supabase was unavailable. So i checked log files and here are the results:
[CODE lang="b4x" highlight="1,2,3,4"]SupabaseAuth: User is logged out, this user must log in again
The user has logged out
SupabaseAuth: User is logged out, this user must log in again
The user has logged out
loading C:\Users\Yiankos\Desktop\Projects\B4J\B4J-SE~4\Objects: copymewithjar.needs...
Using cache system: 3.0
Current App version: 1711010777473
Needs material/awesome icons
GZipping HTML, JavaScript and CSS files...
Optimizing new and updated PNG files...
Building core.min.1711010777473.css...
2024-03-21 10:47:26.568:INFO

ejs.Server:main: jetty-11.0.9; built: 2022-03-30T17:44:47.085Z; git: 243a48a658a183130a8c8de353178d154ca04f04; jvm 14.0.1+7
2024-03-21 10:47:26.619:INFO

ejss.DefaultSessionIdManager:main: Session workerName=node0
2024-03-21 10:47:26.628:INFO

ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@7530ad9c{/,file:///C:/Users/Yiankos/Desktop/Projects/B4J/B4J-SERVER-PERSONAL-PROJECT/Objects/www/,AVAILABLE}
2024-03-21 10:47:26.630:INFO

ejs.RequestLogWriter:main: Opened C:\Users\Yiankos\Desktop\Projects\B4J\B4J-SERVER-PERSONAL-PROJECT\Objects\logs\b4j-2024_03_21.request.log
2024-03-21 10:47:26.667:INFO

ejs.AbstractConnector:main: Started ServerConnector@5891e32e{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2024-03-21 10:47:26.825:INFO

ejus.SslContextFactory:main: x509=X509@5d0a1059(1,h=[wecreateapps.gr, www.wecreateapps.gr],a=[],w=[]) for Server@485966cc[provider=null,keyStore=file:///C:/Users/Yiankos/Desktop/Projects/B4J/B4J-SERVER-PERSONAL-PROJECT/Objects/keystore,trustStore=null]
2024-03-21 10:47:26.900:INFO

ejs.AbstractConnector:main: Started ServerConnector@11c20519{SSL, (ssl, alpn, h2, http/1.1)}{0.0.0.0:8081}
2024-03-21 10:47:26.910:INFO

ejs.Server:main: Started Server@7d3a22a9{STARTING}[11.0.9,sto=0] @7050ms
2024-03-21 10:47:26.913:INFO

ejs.Server:main: Stopped Server@7d3a22a9{STOPPING}[11.0.9,sto=0]
2024-03-21 10:47:26.916:INFO

ejs.AbstractConnector:main: Stopped ServerConnector@5891e32e{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2024-03-21 10:47:26.920:INFO

ejs.AbstractConnector:main: Stopped ServerConnector@11c20519{SSL, (ssl, alpn, h2, http/1.1)}{0.0.0.0:8081}
2024-03-21 10:47:26.921:INFO

ejsh.ContextHandler:main: Stopped o.e.j.s.ServletContextHandler@7530ad9c{/,file:///C:/Users/Yiankos/Desktop/Projects/B4J/B4J-SERVER-PERSONAL-PROJECT/Objects/www/,STOPPED}
2024-03-21 10:47:26.925:INFO

ejs.Server:main: jetty-11.0.9; built: 2022-03-30T17:44:47.085Z; git: 243a48a658a183130a8c8de353178d154ca04f04; jvm 14.0.1+7
2024-03-21 10:47:26.928:INFO

ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@7530ad9c{/,file:///C:/Users/Yiankos/Desktop/Projects/B4J/B4J-SERVER-PERSONAL-PROJECT/Objects/www/,AVAILABLE}
2024-03-21 10:47:26.929:INFO

ejs.RequestLogWriter:main: Opened C:\Users\Yiankos\Desktop\Projects\B4J\B4J-SERVER-PERSONAL-PROJECT\Objects\logs\b4j-2024_03_21.request.log
2024-03-21 10:47:26.929:INFO

ejss.DefaultSessionIdManager:main: Session workerName=node0
2024-03-21 10:47:26.935:INFO

ejs.AbstractConnector:main: Started ServerConnector@5891e32e{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2024-03-21 10:47:27.002:INFO

ejus.SslContextFactory:main: x509=X509@5d99c6b5(1,h=[wecreateapps.gr, www.wecreateapps.gr],a=[],w=[]) for Server@485966cc[provider=null,keyStore=file:///C:/Users/Yiankos/Desktop/Projects/B4J/B4J-SERVER-PERSONAL-PROJECT/Objects/keystore,trustStore=null]
2024-03-21 10:47:27.016:INFO

ejs.AbstractConnector:main: Started ServerConnector@11c20519{SSL, (ssl, alpn, h2, http/1.1)}{0.0.0.0:8081}
2024-03-21 10:47:27.017:INFO

ejs.Server:main: Started Server@7d3a22a9{STARTING}[11.0.9,sto=0] @7157ms
[/CODE]
B4X:
main._appstart (java line: 262)
java.lang.RuntimeException: java.lang.ClassCastException: class b4j.example.supabase$_supabaseerror cannot be cast to class b4j.example.supabase$_supabasedatabaseresult (b4j.example.supabase$_supabaseerror and b4j.example.supabase$_supabasedatabaseresult are in unnamed module of loader 'app')
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:140)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at anywheresoftware.b4a.keywords.Common$3.run(Common.java:1118)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:47)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:43)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:180)
at b4j.example.main._appstart(main.java:262)
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:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at b4j.example.main.main(main.java:28)
Caused by: java.lang.ClassCastException: class b4j.example.supabase$_supabaseerror cannot be cast to class b4j.example.supabase$_supabasedatabaseresult (b4j.example.supabase$_supabaseerror and b4j.example.supabase$_supabasedatabaseresult are in unnamed module of loader 'app')
at b4j.example.classes$ResumableSub_loadUsers.resume(classes.java:1998)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:156)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:105)
... 13 more
main.main (java line: 28)
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassCastException: class b4j.example.supabase$_supabaseerror cannot be cast to class b4j.example.supabase$_supabasedatabaseresult (b4j.example.supabase$_supabaseerror and b4j.example.supabase$_supabasedatabaseresult are in unnamed module of loader 'app')
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:140)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at b4j.example.main.main(main.java:28)
Caused by: java.lang.RuntimeException: java.lang.ClassCastException: class b4j.example.supabase$_supabaseerror cannot be cast to class b4j.example.supabase$_supabasedatabaseresult (b4j.example.supabase$_supabaseerror and b4j.example.supabase$_supabasedatabaseresult are in unnamed module of loader 'app')
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:140)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at anywheresoftware.b4a.keywords.Common$3.run(Common.java:1118)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:47)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:43)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:180)
at b4j.example.main._appstart(main.java:262)
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:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
... 2 more
Caused by: java.lang.ClassCastException: class b4j.example.supabase$_supabaseerror cannot be cast to class b4j.example.supabase$_supabasedatabaseresult (b4j.example.supabase$_supabaseerror and b4j.example.supabase$_supabasedatabaseresult are in unnamed module of loader 'app')
at b4j.example.classes$ResumableSub_loadUsers.resume(classes.java:1998)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:156)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:105)
... 13 more
According to logs, at begging of the app there are two tries to get the supabase user("The user has logged out"), even if there is no such a code and that causes these two RuntimeException.
At my local pc everything was working fine(supabase initiliazed correctly) until i tried to find out a way to reproduce it. So, i realised that if you delete the file "supabaseauthtoken.dat" from the project's Object folder and you try release the app/server then throws this error too at my pc.
So, if i understand correctly if there is a fresh install of a release app then connection is unavailable. When i say fresh install, i mean "supabaseauthtoken.dat" does not exists before first run.
In debug mode, if you delete the file before the debug run, throws the same errors but connection is done.
Here is my main's page code:
B4X:
Sub AppStart (Args() As String)
xSupabase.Initialize("https://*****.supabase.co","******")
xSupabase.InitializeEvents(Me,"Supabase")
xSupabase.LogEvents = True
' the user needs to login
ABMShared.NeedsAuthorization = True
' Build the Theme
ABMShared.BuildTheme("mytheme")
' create the app
Dim myApp As ABMApplication
myApp.Initialize
' create the pages
Dim mainPage As ABMMainPage
mainPage.Initialize
' add the pages to the app
myApp.AddPage(mainPage.page)
' start the server
myApp.StartServerHTTP2(srvr,"srvr",port,sslPorts,"keystore","****","****")
ABMShared.RedirectOutput(File.DirApp, "logs.txt")
#If DEBUG
' or just open de browser, no multiple devices
ABM.ViewerOpen("https://localhost:" & sslPorts & "/" & ABMShared.AppName & "/")
#End If
StartMessageLoop
End Sub