Bug 1130407

Summary: Websockets for Tomcat 7 (JBoss EWS 2.0) cartridge does not work
Product: OpenShift Online Reporter: Leonardo Uribe <lu4242>
Component: ImageAssignee: Andy Goldstein <agoldste>
Status: CLOSED NOTABUG QA Contact: libra bugs <libra-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: jokerman, lu4242, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-15 18:50:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Leonardo Uribe 2014-08-15 07:27:02 UTC
Description of problem:

I tried to create a demo web application using Tomcat 7 (JBoss EWS 2.0) cartridge, just to check if websockets worked and I noticed that websockets does not work. As soon as the socked is open, it is closed. Then I tried to make a diy Cartridge (tomcat 7.0.55) myself, and the same behavior was found. I let the app working here

http://tomcat-cladile.rhcloud.com:8000/examples/websocket/echo.xhtml

But I found this app showing that a previous version of tomcat (7.0.39) with websockets work:

http://tomcat7-riverwind.rhcloud.com:8000/examples/websocket/echo.html

I tried to make it work with that version without success

The funny part is that I tried wildfly 8.1 cartridge and I found websockets worked well.

The issue has been reported before by other users out there. It doesn't look something related to tomcat, because the app works when tomcat is started locally. It should be something related to openshift that affects tomcat. 

Version-Release number of selected component (if applicable):


How reproducible:

http://tomcat-cladile.rhcloud.com:8000/examples/websocket/echo.xhtml

Steps to Reproduce:
1. go to the url
2. try the example
3. the socket is closed as soon as it opens. Code 1011 is returned.

or try this:

1. create an app with Tomcat 7 (JBoss EWS 2.0) cartridge 
2. copy websocket example dristributed with tomcat.
3. run the app and see the results.

Actual results:

websocket is closed after it is open

Expected results:

websocket must remain open for 20 seconds after timeout closes it.

Additional info:

Comment 1 Andy Goldstein 2014-08-15 17:15:21 UTC
EWS 2 ships with Tomcat 7.0.40, which does provide support for WebSockets, but it doesn't provide support for JSR 356, which enables scanning for classes annotated with @ServerEndpoint etc.

Could you try the examples that ship with Tomcat 7.0.40 and see if they work for you?

Comment 2 Andy Goldstein 2014-08-15 18:50:18 UTC
Tested using the examples from the 7.0.40 Tomcat release - they work fine.

If/when EWS supports JSR 356, we can look into possibly upgrading the EWS cartridge.

Comment 3 Leonardo Uribe 2014-08-17 07:03:05 UTC
I finally have some time to try it and I confirm that with Tomcat 7 (JBoss EWS 2.0) cartridge shipping 7.0.40 websockets works. It is unfortunate that JSR 356 is not supported. I tried the native websockets with Tomcat 7.0.55 (DIY cartridge) and it doesn't work, which is weird, because it should but maybe there was a change in some point of time. Anyway, I was just looking for a solution that allowed me to use Tomcat as web server. 

Thanks for your help :).