Sablo websocket connection issue

Questions and Answers on installation, deployment, management, locking, tranasactions of Servoy Application Server

Sablo websocket connection issue

Postby wern.foong » Tue Jul 19, 2022 6:39 pm

Hi,

I exported an NG application to WAR file using Servoy 2021.03.2 and deployed to Tomcat. When I try to load the application from the browser, the login form doesn't show up. All I can see are the words "Disconnected from server, Reconnecting...." It appears that the Sablo websocket connection failed.

From the log file I can see the following exception:
Code: Select all
19-Jul-2022 23:59:45.535 SEVERE [http-nio-8109-exec-2] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [default] in context with path [] threw exception
java.lang.IllegalArgumentException: checkOrigin: No Host header set for this request, is the SecurityFilter correctly set-up in the web.xml/fragment?
        at org.sablo.websocket.GetHttpSessionConfigurator.getHostFromCurrentHostHeader(GetHttpSessionConfigurator.java:186)
        at org.sablo.websocket.GetHttpSessionConfigurator.lambda$1(GetHttpSessionConfigurator.java:116)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
        at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
        at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
        at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
        at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
        at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:449)
        at org.sablo.websocket.GetHttpSessionConfigurator.checkOrigin(GetHttpSessionConfigurator.java:117)
        at org.apache.tomcat.websocket.server.UpgradeUtil.doUpgrade(UpgradeUtil.java:116)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:77)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at org.apache.catalina.filters.RequestDumperFilter.doFilter(RequestDumperFilter.java:203)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)


From the Tomcat log file, we can see that Tomcat actually received the Host header.
Code: Select all
19-Jul-2022 23:59:45.472 FINE [http-nio-8109-Acceptor-0] org.apache.tomcat.util.threads.LimitLatch.countUpOrAwait Counting up[http-nio-8109-Acceptor-0] latch=1
19-Jul-2022 23:59:45.473 FINE [http-nio-8109-exec-10] org.apache.coyote.http11.AbstractNioInputBuffer.parseRequestLine Received [GET /websocket/2/null/1?connectNr=3880002253670&solution=ng_wmt_main HTTP/1.1
Host: localhost:8109
Connection: Upgrade
Pragma: no-cache
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
Upgrade: websocket
Origin: http://localhost:8109
Sec-WebSocket-Version: 13
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Cookie: JSESSIONID=1234567890
Sec-WebSocket-Key: 1234567890
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

]
19-Jul-2022 23:59:45.474 FINE [http-nio-8109-exec-10] org.apache.catalina.connector.CoyoteAdapter.parsePathParameters The variable [uriBC] has value [/websocket/2/null/1]
19-Jul-2022 23:59:45.474 FINE [http-nio-8109-exec-10] org.apache.catalina.connector.CoyoteAdapter.parsePathParameters The variable [semicolon] has value [-1]
19-Jul-2022 23:59:45.474 FINE [http-nio-8109-exec-10] org.apache.catalina.connector.CoyoteAdapter.parsePathParameters The variable [enc] has value [utf-8]
19-Jul-2022 23:59:45.475 FINE [http-nio-8109-exec-10] org.apache.tomcat.util.http.LegacyCookieProcessor.parseCookieHeader Cookies: Parsing b[]: JSESSIONID=1234567890
19-Jul-2022 23:59:45.475 FINE [http-nio-8109-exec-10] org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId  Requested cookie session id is 1234567890
19-Jul-2022 23:59:45.475 FINE [http-nio-8109-exec-10] org.apache.catalina.authenticator.AuthenticatorBase.invoke Security checking request GET /websocket/2/null/1
19-Jul-2022 23:59:45.475 FINE [http-nio-8109-exec-10] org.apache.catalina.realm.RealmBase.findSecurityConstraints   No applicable constraints defined
19-Jul-2022 23:59:45.475 FINE [http-nio-8109-exec-10] org.apache.catalina.authenticator.AuthenticatorBase.invoke  Not subject to any constraint
19-Jul-2022 23:59:45.476 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10 START TIME        =19-Jul-2022 23:59:45
19-Jul-2022 23:59:45.476 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10         requestURI=/websocket/2/null/1
19-Jul-2022 23:59:45.476 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10           authType=null
19-Jul-2022 23:59:45.476 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10  characterEncoding=null
19-Jul-2022 23:59:45.476 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10      contentLength=-1
19-Jul-2022 23:59:45.476 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10        contentType=null
19-Jul-2022 23:59:45.476 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10        contextPath=
19-Jul-2022 23:59:45.476 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             cookie=JSESSIONID=1234567890
19-Jul-2022 23:59:45.477 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             header=host=localhost:8109
19-Jul-2022 23:59:45.477 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             header=connection=Upgrade
19-Jul-2022 23:59:45.477 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             header=pragma=no-cache
19-Jul-2022 23:59:45.477 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             header=cache-control=no-cache
19-Jul-2022 23:59:45.477 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             header=user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
19-Jul-2022 23:59:45.477 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             header=upgrade=websocket
19-Jul-2022 23:59:45.477 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             header=origin=http://localhost:8109
19-Jul-2022 23:59:45.477 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             header=sec-websocket-version=13
19-Jul-2022 23:59:45.477 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             header=accept-encoding=gzip, deflate, br
19-Jul-2022 23:59:45.478 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             header=accept-language=en-US,en;q=0.9
19-Jul-2022 23:59:45.478 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             header=cookie=JSESSIONID=1234567890
19-Jul-2022 23:59:45.478 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             header=sec-websocket-key=1234567890
19-Jul-2022 23:59:45.478 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             header=sec-websocket-extensions=permessage-deflate; client_max_window_bits
19-Jul-2022 23:59:45.478 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             locale=en_US
19-Jul-2022 23:59:45.478 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             method=GET
19-Jul-2022 23:59:45.478 FINE [http-nio-8109-exec-10] org.apache.tomcat.util.http.Parameters.setEncoding Set encoding to ISO-8859-1
19-Jul-2022 23:59:45.479 FINE [http-nio-8109-exec-10] org.apache.tomcat.util.http.Parameters.setQueryStringEncoding Set query string encoding to ISO-8859-1
19-Jul-2022 23:59:45.479 FINE [http-nio-8109-exec-10] org.apache.tomcat.util.http.Parameters.handleQueryParameters Decoding query null ISO-8859-1
19-Jul-2022 23:59:45.479 FINE [http-nio-8109-exec-10] org.apache.tomcat.util.http.Parameters.processParameters Start processing with input [connectNr=3880002253670&solution=ng_wmt_main]
19-Jul-2022 23:59:45.479 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10          parameter=connectNr=3880002253670
19-Jul-2022 23:59:45.479 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10          parameter=solution=ng_wmt_main
19-Jul-2022 23:59:45.479 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10           pathInfo=null
19-Jul-2022 23:59:45.479 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10           protocol=HTTP/1.1
19-Jul-2022 23:59:45.479 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10        queryString=connectNr=3880002253670&solution=ng_wmt_main
19-Jul-2022 23:59:45.479 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10         remoteAddr=0:0:0:0:0:0:0:1
19-Jul-2022 23:59:45.480 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10         remoteHost=0:0:0:0:0:0:0:1
19-Jul-2022 23:59:45.480 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10         remoteUser=null
19-Jul-2022 23:59:45.480 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10 requestedSessionId=1234567890
19-Jul-2022 23:59:45.480 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10             scheme=http
19-Jul-2022 23:59:45.480 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10         serverName=localhost
19-Jul-2022 23:59:45.480 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10         serverPort=8109
19-Jul-2022 23:59:45.480 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10        servletPath=/websocket/2/null/1
19-Jul-2022 23:59:45.480 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10           isSecure=false
19-Jul-2022 23:59:45.480 INFO [http-nio-8109-exec-10] org.apache.catalina.filters.RequestDumperFilter.doLog http-nio-8109-exec-10 ------------------=--------------------------------------------
19-Jul-2022 23:59:45.483 FINE [http-nio-8109-exec-10] org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process Socket: [org.apache.tomcat.util.net.NioEndpoint$KeyAttachment@54829899:org.apache.tomcat.util.net.NioChannel@1ce4f04a:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8109 remote=/0:0:0:0:0:0:0:1:56988]], Status in: [OPEN_READ], State out: [CLOSED]
19-Jul-2022 23:59:45.483 FINE [http-nio-8109-exec-10] org.apache.tomcat.util.threads.LimitLatch.countDown Counting down[http-nio-8109-exec-10] latch=1


I'm aware that there is setting in the Admin page called "sablo.websocket.origin.check" which can be used to skip the origin checking, but it probably shouldn't be used under normal circumstances. The NG application is deployed to local machine and there is no proxy server in between. The strange thing is, I have another NG application running without this issue. I tried to compare the 2 applications and the Tomcat configuration but so far haven't noticed anything that could be causing the issue.

Does anybody know how to resolve this issue?
wern.foong
 
Posts: 3
Joined: Thu Sep 12, 2019 3:08 am

Re: Sablo websocket connection issue

Postby wern.foong » Wed Jul 27, 2022 1:54 pm

After comparing with another NG application that works, found out that the configuration for sablo connection is indeed missing from the web.xml in the WAR file.
wern.foong
 
Posts: 3
Joined: Thu Sep 12, 2019 3:08 am


Return to Servoy Server

Who is online

Users browsing this forum: No registered users and 6 guests