Bug 1130407 - Websockets for Tomcat 7 (JBoss EWS 2.0) cartridge does not work
Summary: Websockets for Tomcat 7 (JBoss EWS 2.0) cartridge does not work
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Andy Goldstein
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-15 07:27 UTC by Leonardo Uribe
Modified: 2015-05-15 00:44 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-15 18:50:18 UTC


Attachments (Terms of Use)

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 :).


Note You need to log in before you can comment on or make changes to this bug.