Bug 1083038 - Make it possible to enable websockets for a deployment from jboss-web.xml rather than requiring inclusion of enable-websockets.jar
Summary: Make it possible to enable websockets for a deployment from jboss-web.xml rat...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Build
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ER2
: EAP 6.3.0
Assignee: Emmanuel Hugonnet (ehsavoie)
QA Contact: Pavel Jelinek
URL:
Whiteboard:
Depends On:
Blocks: eap63-beta-blockers
TreeView+ depends on / blocked
 
Reported: 2014-04-01 11:30 UTC by Radim Hatlapatka
Modified: 2015-04-28 15:09 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-28 15:41:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker EAP6-6 0 Major Closed WebSockets 2017-04-04 08:40:21 UTC
Red Hat Issue Tracker JBMETA-375 0 Major Resolved Be able to turn on web sockets in jboss-web.xml 2017-04-04 08:40:21 UTC

Description Radim Hatlapatka 2014-04-01 11:30:01 UTC
Description of problem:
Websockets are new feature in EAP 6.3 (jbossweb) [1] and require enable-websockets.jar to enable them => it needs to be productized. You can find it in jbossweb upstream in res/enable-websockets.jar (=> e.g. http://anonsvn.jboss.org/repos/jbossweb/branches/7.4.x/res/enable-websockets.jar)

Productized version should contain some notes (e.g. readme) explaining customer how to use it (adding it to websocket application to WEB-INF/lib)

[1] https://issues.jboss.org/browse/EAP6-6

Comment 2 Marek Schmidt 2014-04-01 11:42:00 UTC
Wouldn't it be better to have some propritary websockets activation element in web.xml or jboss-web.xml instead of an "activation jar"?

Comment 3 Radim Hatlapatka 2014-04-01 11:52:10 UTC
I would prefer having configuration option in web subsystem which would enable websockets globally. In Wildfly (undertow) there is no need to enable websockets in each deployed web application.

Comment 4 Radim Hatlapatka 2014-04-01 11:57:40 UTC
The Comment 2 and Comment 3 are questions for Remy or Jean Frederic, could you provide some information for reasons that websockets are activated via activation jar?

Comment 5 Marek Schmidt 2014-04-01 12:07:13 UTC
Websockets in Wildfly are defined by EE7 spec, so they don't have to be activated, OTOH websockets in EAP6 are a proprietary extension of the web subsystem on top of EE6, so the proper mechanism would be jboss-web.xml IMHO.

Comment 6 Radim Hatlapatka 2014-04-01 13:15:31 UTC
The websockets in jbossweb works only when using JDK 1.7 and higher. You can't use them with JDK 1.6.

Thereby there could be option allowing to set websocket globally if it would be set on JDK 1.6 an exception would be thrown that to use this feature JDK 1.7 is required.

Comment 7 Jean-frederic Clere 2014-04-01 15:06:53 UTC
the code is in https://svn.jboss.org/repos/jbossweb/branches/7.4.x/res/enable-websockets/

Adding a jar doesn't seem as nice way.

Probably  <web-sockets enabled="true"/> in the jboss-web.xml and auto magically add the stuff in webapp deployment is better.

that requires changes in the integration code and in metadata.

Comment 8 Kabir Khan 2014-04-01 15:28:08 UTC
https://issues.jboss.org/browse/JBMETA-375 contains the Jira for exposing this in jboss web. An alternative would be to port the deployment processor to scan for the relevant annotations (there should be a counterpart in WildFly) and add things to the deployment.

Can you be a bit more specific about what exactly needs to go into the deployment?

Comment 9 JBoss JIRA Server 2014-04-04 13:57:16 UTC
Carlo de Wolf <cdewolf> updated the status of jira JBMETA-375 to Resolved

Comment 10 Kabir Khan 2014-04-08 09:25:17 UTC
https://github.com/jbossas/jboss-eap/pull/1188

Comment 11 Kabir Khan 2014-04-08 14:06:02 UTC
Changed the title as discussed on PM call to match Emmanuel's fix. Old title: "Websockets in jbossweb require enable-websockets.jar to enable them => it needs to be productized". 

Note that including the enable-websockets.jar in the deployment will still work, but it is no longer a requirement, so we should not ship these jars, and they no longer need to be productised.

Comment 13 Kabir Khan 2014-04-09 15:04:25 UTC
Prod rebuild pr https://github.com/jbossas/jboss-eap/pull/1203

Comment 14 Radim Hatlapatka 2014-04-30 13:38:57 UTC
Created pull request [1] with test covering enabling websockets using jboss-web.xml.
[1] https://github.com/jbossas/jboss-eap/pull/1292

Comment 15 Radim Hatlapatka 2014-04-30 13:39:40 UTC
Verified in EAP 6.3.0.ER2

Comment 17 Scott Mumford 2014-05-14 00:26:22 UTC
In order to add this to the 6.3.0 Beta Release Notes, I need a clear outline of how this was implemented.

Was a .jar file used, or is there now an XML setting that customers need to set in order to activate websockets (if so, where is it and what's the syntax)?

Comment 18 Emmanuel Hugonnet (ehsavoie) 2014-05-14 05:43:48 UTC
You can still use the .jar file but this is not recommended.
For enabling websockets in your application you need :
 - running the server on JDK >= 7.
 - configure the web http connector to use the NIO2 connector :
/subsystem=web/connector=http/:write-attribute(name=protocol,value=org.apache.coyote.http11.Http11NioProtocol) 
 - add or edit the WEB-INF/jboss-web.xml file and enable websockets with the flag : <enable-websockets>true</enable-websockets>

You can take a look at the documentation :
http://documentation-devel.engineering.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.3/html-single/Development_Guide/index.html#chap-WebSockets
and the related quickstarts :
https://github.com/jboss-developer/jboss-eap-quickstarts/blob/6.3.x-develop/websocket-hello/

Comment 19 JBoss JIRA Server 2015-04-28 15:09:26 UTC
John Doyle <jdoyle> updated the status of jira EAP6-6 to Closed


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