DarkoT Active Member Licensed User Longtime User Jan 15, 2025 #1 I need help. In the B4J environment (desktop Windows), I created a WebSocket server and a WebSocket client application. If I compile the server in release mode, it works, and the client application also works when run from the B4J IDE (debug mode). However, if I compile the client app in release mode and run it in the Windows environment, the system reports an error — on the server side, I get the following: onWebSocketError: null. Does anyone have any idea what could be wrong? Alternatively, how can I catch the error in release mode (everything works fine in debug mode)? Br, DaT
I need help. In the B4J environment (desktop Windows), I created a WebSocket server and a WebSocket client application. If I compile the server in release mode, it works, and the client application also works when run from the B4J IDE (debug mode). However, if I compile the client app in release mode and run it in the Windows environment, the system reports an error — on the server side, I get the following: onWebSocketError: null. Does anyone have any idea what could be wrong? Alternatively, how can I catch the error in release mode (everything works fine in debug mode)? Br, DaT
Solution teddybear Jan 15, 2025 DarkoT said: version 1.13 (internal) It's really strange situation... In debug mode - everthing works perfect's, after I create windows exe, system will not connect (on same machine) to ws.. Really have no idea what is wrong, I made research over all net... Click to expand... Now I got you what you mean release mode is , you mean that is build standalone package. You need to add this PackagerProperty for standalone B4X: #PackagerProperty: AdditionalModuleInfoString = uses org.eclipse.jetty.websocket.common.RemoteEndpointFactory;
DarkoT said: version 1.13 (internal) It's really strange situation... In debug mode - everthing works perfect's, after I create windows exe, system will not connect (on same machine) to ws.. Really have no idea what is wrong, I made research over all net... Click to expand... Now I got you what you mean release mode is , you mean that is build standalone package. You need to add this PackagerProperty for standalone B4X: #PackagerProperty: AdditionalModuleInfoString = uses org.eclipse.jetty.websocket.common.RemoteEndpointFactory;
teddybear Well-Known Member Licensed User Jan 15, 2025 #2 Here it works, which version of jwebsocketclient are you using? Upvote 0
DarkoT Active Member Licensed User Longtime User Jan 15, 2025 #3 teddybear said: Here it works, which version of jwebsocketclient are you using? Click to expand... version 1.13 (internal) It's really strange situation... In debug mode - everthing works perfect's, after I create windows exe, system will not connect (on same machine) to ws.. Really have no idea what is wrong, I made research over all net... Upvote 0
teddybear said: Here it works, which version of jwebsocketclient are you using? Click to expand... version 1.13 (internal) It's really strange situation... In debug mode - everthing works perfect's, after I create windows exe, system will not connect (on same machine) to ws.. Really have no idea what is wrong, I made research over all net...
C Chris2 Well-Known Member Licensed User Longtime User Jan 15, 2025 #4 DarkoT said: version 1.13 (internal) Click to expand... Assuming that you're using Java 11+, try this later version of jWebsocketClient: https://www.b4x.com/android/forum/threads/jwebsocketclientv2.156357/post-963635 There was a Jetty incompatibility I think that led to intermittant WS connection issues. Edit: Incidentally, I think if you're using the latest B4J version the internal jWebsocketClient version should be 2.00 Upvote 0
DarkoT said: version 1.13 (internal) Click to expand... Assuming that you're using Java 11+, try this later version of jWebsocketClient: https://www.b4x.com/android/forum/threads/jwebsocketclientv2.156357/post-963635 There was a Jetty incompatibility I think that led to intermittant WS connection issues. Edit: Incidentally, I think if you're using the latest B4J version the internal jWebsocketClient version should be 2.00
teddybear Well-Known Member Licensed User Jan 15, 2025 #5 DarkoT said: version 1.13 (internal) It's really strange situation... In debug mode - everthing works perfect's, after I create windows exe, system will not connect (on same machine) to ws.. Really have no idea what is wrong, I made research over all net... Click to expand... Now I got you what you mean release mode is , you mean that is build standalone package. You need to add this PackagerProperty for standalone B4X: #PackagerProperty: AdditionalModuleInfoString = uses org.eclipse.jetty.websocket.common.RemoteEndpointFactory; Last edited: Jan 15, 2025 Upvote 1 Solution
DarkoT said: version 1.13 (internal) It's really strange situation... In debug mode - everthing works perfect's, after I create windows exe, system will not connect (on same machine) to ws.. Really have no idea what is wrong, I made research over all net... Click to expand... Now I got you what you mean release mode is , you mean that is build standalone package. You need to add this PackagerProperty for standalone B4X: #PackagerProperty: AdditionalModuleInfoString = uses org.eclipse.jetty.websocket.common.RemoteEndpointFactory;
DarkoT Active Member Licensed User Longtime User Jan 16, 2025 #6 teddybear said: Now I got you what you mean release mode is , you mean that is build standalone package. You need to add this PackagerProperty for standalone B4X: #PackagerProperty: AdditionalModuleInfoString = uses org.eclipse.jetty.websocket.common.RemoteEndpointFactory; Click to expand... Thank you for your help... That's the solution... I added an extra line with #PackageProperty to the client, and now the system works... Thanks for the help and best regards to the whole community... You guys rock Upvote 0
teddybear said: Now I got you what you mean release mode is , you mean that is build standalone package. You need to add this PackagerProperty for standalone B4X: #PackagerProperty: AdditionalModuleInfoString = uses org.eclipse.jetty.websocket.common.RemoteEndpointFactory; Click to expand... Thank you for your help... That's the solution... I added an extra line with #PackageProperty to the client, and now the system works... Thanks for the help and best regards to the whole community... You guys rock
C Chris2 Well-Known Member Licensed User Longtime User Jan 16, 2025 #7 Note that if at some point you update to use jWebsocketClient V2.00 then you'll need to use different PackagerProperty settings, as detailed in @Erel's post I linked to above. Upvote 0
Note that if at some point you update to use jWebsocketClient V2.00 then you'll need to use different PackagerProperty settings, as detailed in @Erel's post I linked to above.