0

I got issue on primefaces push in my Tomcat with Apache 24.

Below is the error shown :

java.lang.UnsupportedOperationException: HTTP upgrade is not supported by the AJP protocol

Belows is the error in the web chrome console

WebSocket connection to 'wss://myhost.com/primepush/customers/org?X-…ransport=websocket&X-Atmosphere-TrackMessageSize=true&X-atmo-protocol=true' failed: Error during WebSocket handshake: Unexpected response code: 500
Websocket closed, reason: Connection was closed abnormally (that is, with no close frame being sent). - wasClean: false
Websocket failed on first connection attempt. Downgrading to long-polling and resending

I read that the AJP protocol does not support upgrading to other protocols (e.g. websocket, HTTP/2). And I might need to setup my reverse proxy , but I am a bit confused on how to set it correctly. Anyone have experience on this?

Note: This is work if I don't use Apache and just straight normal HTTP.

Current reverse proxy setup for this ws:

LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so

ProxyPass         /primepush/  ws://localhost:8080/primepush/
ProxyPassReverse  /primepush/  ws://localhost:8080/primepush/

I also add the connector in my tomcat

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

Error found with above setup :

AH01144: No protocol handler was valid for the URL /primepush/customers....
make sure the proxy submodules are included in the configuration using LoadModule.

Below is the ws module status :

 proxy_wstunnel_module (shared)

I also found strange things :

  • When I go to the page that have this push at the first time (using the link) it work fine, there is no error in the log, there also no error in the console web. The push also work correctly.
  • But when I refresh that page, the error come out in the console and in the error.log. In web it show GET https://myhost.com/primepush... 505 error. It also show this warn in chrome console : Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience.

Additional info: The push is working nevertheless, there is no message that it down grade to poll, but I am just really concern what will this error root cause and what will it impact.

leafy
  • 156
  • 1
  • 8
  • Find out how this should be done with 'atmosphere' and you have the PrimeFaces Push solution to since that is what it is based on – Kukeltje May 12 '17 at 09:15
  • @Kukeltje I actually follow the fix on reverse proxy (that does not work for me) I update the question with more detail on my configuration in case you know whats wrong with it. – leafy May 12 '17 at 10:25

0 Answers0