Hello,
I’m working on a project where we’ve implemented “push” behavior, which doesn’t “behave” the way we expect it to when Apache is the way.
Using Vaadin 7.5, Tomcat 8.0.23, Apache 2.2.15, Chrome 45.0.2454.101 m, Firefox 41.0.1.
We do get the UI behaving fine when the URL directly aims at Tomcat’s http port, so we know that push mechanism works. But when the URL goes through Apache, it hangs.
The error, (provided by Chrome webdev toolkit) :
vaadinPush.js?v=7.5.0:25 Vaadin push loaded /
“WebSocket connection to 'ws://10.198.133.116:8080/gaap/PUSH?v-uiId=1&v-csrfToken=ccd23926-8d36-448f-941c-13b12cd7fe89&X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.2.6.vaadin4-jquery&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&Content-Type=application/json;%20charset=UTF-8&X-atmo-protocol=true'
failed: Error during WebSocket handshake: Unexpected response code: 500
What I tried:
(from
http://stackoverflow.com/questions/18918392/how-to-get-vaadin-push-work-through-apache-http-server
)
[code]
Add this in httpd.conf
RewriteEngine on
RewriteCond %{QUERY_STRING} ^((?!X-Atmosphere-Transport=websocket).)*$
RewriteRule ^/PUSH/ http://serverIpAdress:8080/gaap/PUSH/$1 [P]
ProxyPass /gaap/PUSH/ ws:// serverIpAdress:8080/gaap/PUSH/
ProxyPassReverse /gaap/PUSH/ ws:// serverIpAdress:8080/gaap/PUSH/
ProxyPass /gaap/VAADIN/ ws:// serverIpAdress:8080/gaap/VAADIN/
ProxyPassReverse /gaap/VAADIN/ ws:// serverIpAdress:8080/gaap/VAADIN
ProxyPass / ajp://localhost:9700/
[/code]In Tomcat’s server.xml :
[code]
<Executor name="OrangeAjpThreadPool"
namePrefix="orange-ajp-exec-"
maxThreads="256"
minSpareThreads="25"
prestartminSpareThreads="true"
maxIdleTime="60000"/>
<Connector port="9700"
protocol="org.apache.coyote.ajp.AjpNioProtocol"
acceptCount="256"
connectionTimeout="5000"
keepAliveTimeout="60000"
maxConnections="10000"
enableLookups="false"
executor="OrangeAjpThreadPool"
acceptorThreadCount="1"
/>
[/code]In this post,
Vaadin 7.1 - push implementation lacking
, I read that push with Vaadin wasn’t that sharp, but I’m sure this is obsolete news now ?
The issue only pops out when Apache’s dealing with push ; but there again, I guess it’s just me ignoring how to tune it, though I’ve been crawling the Web for a while.
So, any enlightenment