B4J Question Websocket crashing since 2 days

tufanv

Expert
Licensed User
Longtime User
Hello,

I am using a b4j solution on my server to connect to a data provider's websocket and receive data. I had no problems until this day but for the last 2 days at exact time every evening the app crashes on my server. Probably they changed something on their side. The error log is like this: I probably can do something to avoid it, like try catch etc and I already have them but it is obvious that there is a problem somewhere:

B4X:
nohup: ignoring input
2020-04-08 10:33:58.040:INFO::main: Logging initialized @123ms to org.eclipse.jetty.util.log.StdErrLog
Wed Apr 08 10:33:58 EET 2020 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Wed Apr 08 21:18:20 EET 2020 WARN: Caught while disconnecting...

EXCEPTION STACK TRACE:



** BEGIN NESTED EXCEPTION **

javax.net.ssl.SSLException
MESSAGE: closing inbound before receiving peer's close_notify

STACKTRACE:

javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify
    at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:133)
    at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117)
    at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:307)
    at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:263)
    at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:254)
    at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:645)
    at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:624)
    at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:2249)
    at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4232)
    at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1472)
    at anywheresoftware.b4j.objects.SQL.Close(SQL.java:487)
    at b4j.example.main$ResumableSub_ws_closed.resume(main.java:353)
    at b4j.example.main._ws_closed(main.java:329)
    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:91)
    at anywheresoftware.b4a.BA$3.run(BA.java:247)
    at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
    at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
    at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:153)
    at b4j.example.main._appstart(main.java:65)
    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:91)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at b4j.example.main.main(main.java:28)


** END NESTED EXCEPTION **


Wed Apr 08 21:21:22 EET 2020 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Wed Apr 08 21:21:24 EET 2020 WARN: Caught while disconnecting...

EXCEPTION STACK TRACE:



** BEGIN NESTED EXCEPTION **

javax.net.ssl.SSLException
MESSAGE: closing inbound before receiving peer's close_notify

STACKTRACE:

javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify
    at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:133)
    at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117)
    at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:307)
    at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:263)
    at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:254)
    at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:645)
    at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:624)
    at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:2249)
    at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4232)
    at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1472)
    at anywheresoftware.b4j.objects.SQL.Close(SQL.java:487)
    at b4j.example.main$ResumableSub_ws_closed.resume(main.java:353)
    at b4j.example.main._ws_closed(main.java:329)
    at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    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:91)
    at anywheresoftware.b4a.BA$3.run(BA.java:247)
    at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
    at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
    at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:153)
    at b4j.example.main._appstart(main.java:65)
    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:91)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at b4j.example.main.main(main.java:28)


** END NESTED EXCEPTION **


main._appstart (java line: 65)
java.lang.RuntimeException: org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint unavailable, current state [CLOSED], expecting [OPEN or CONNECTED]
    at anywheresoftware.b4a.keywords.Common$2$1.run(Common.java:1020)
    at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
    at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
    at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:153)
    at b4j.example.main._appstart(main.java:65)
    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:91)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at b4j.example.main.main(main.java:28)
Caused by: org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint unavailable, current state [CLOSED], expecting [OPEN or CONNECTED]
    at org.eclipse.jetty.websocket.common.WebSocketSession.getRemote(WebSocketSession.java:411)
    at anywhersoftware.b4j.objects.WebSocketClientWrapper.SendText(WebSocketClientWrapper.java:101)
    at b4j.example.main$ResumableSub_ws_connected.resume(main.java:423)
    at anywheresoftware.b4a.keywords.Common$2$1.run(Common.java:1018)
    ... 11 more
 

drgottjr

Expert
Licensed User
Longtime User
have you asked you data provider if their certificate has expired?
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
other side may want ssl. on the b4a side, there is a way to accept "all", meaning you don't care if cert. is bad. see if b4j offers the same "feature".
i think maybe here
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
other side may want ssl. on the b4a side, there is a way to accept "all", meaning you don't care if cert. is bad. see if b4j offers the same "feature".
i think maybe here
Looking at the error message, it seems to be a MySQL issue. Has the MySQL server been updated?
The useSSL=false needs to be done in the JDBC connection string. Sort of like
jdbc:mysql://localhost:yourPortNumber/yourDatabaseName?useSSL=false
 
Upvote 0
Top