I don't think this still applies to your problem (could be wrong) but as I understand it, your jServer works just fine and the problem only occurs when you try to package it?
Good point!
Looking back at what I did (although I might be wasting your time here, I've never been sure it was correct or necesary as
@alwaysbusy suggested. I implemented it when trying to resolve intermittent WS connection issues that turned out to be a jetty incompatibility between client & server, and it just got left in)...
I didn't add the js file, I just created a filter to force the creation of an HTTPSession on WS connections:
srvr.AddFilter("/ws", "SessionCreator", False) 'https://www.b4x.com/android/forum/threads/jserver-v4-0-based-on-jetty-11.140437/
'Filter class
Sub Class_Globals
End Sub
Public Sub Initialize
End Sub
'Return True to allow the request to proceed.
Public Sub Filter(req As ServletRequest, resp As ServletResponse) As Boolean
req.GetSession 'a new session will be created if a session doesn't exist.
Return True
End Sub
UPDATE: I think I'm leading you astray here. I just did a quick test, removing the srvr.AddFilter("/ws", "SessionCreator", False) line from my jServer app and it still seems to run OK without it. It might still be worth a try though I guess.