Bug 1256945
Summary: | javax.websocket.server.ServerEndpoints registered at "/" are ignored | ||
---|---|---|---|
Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | tcrawley |
Component: | Web | Assignee: | Tomas Hofman <thofman> |
Status: | CLOSED NOTABUG | QA Contact: | Radim Hatlapatka <rhatlapa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.4.3 | CC: | bbaranow, rmaucher, tcrawley, thofman |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-09-01 13:54:40 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
tcrawley
2015-08-25 19:56:55 UTC
It looks this is because path '/' conflicts with index.html file in WEB-INF/ -> you can't have two resources mapped to the same path. If you rename the file to e.g. index2.html, clean & redeploy, then it works. Closing as not a bug, please reopen if you disagree. I tried that - I moved index.html -> index2.html, cleaned, and redeployed. If I then load index2.html and try to open the connection, I still get a 302 to http://localhost:8080/jboss-websocket-hello/ This was with EAP 6.4.3, is that the version you tested with? Can you verify that there is no index.html file left in your war? Also, if you try to access the original address http://localhost:8080/jboss-websocket-hello/ (or also http://localhost:8080/jboss-websocket-hello/index.html) it should now return 404. Is that so? I tested with current SNAPSHOT and also with 6.4.3. > Can you verify that there is no index.html file left in your war? Yes, the war contains: 0 Fri Aug 28 14:47:30 EDT 2015 META-INF/ 127 Fri Aug 28 14:47:28 EDT 2015 META-INF/MANIFEST.MF 0 Fri Aug 28 14:47:30 EDT 2015 WEB-INF/ 0 Fri Aug 28 14:47:30 EDT 2015 WEB-INF/classes/ 0 Fri Aug 28 14:47:30 EDT 2015 resources/ 0 Fri Aug 28 14:47:30 EDT 2015 resources/css/ 1210 Thu Aug 27 10:41:22 EDT 2015 WEB-INF/jboss-web.xml 4732 Tue Aug 25 14:51:00 EDT 2015 index2.html 1118 Tue Aug 25 13:10:20 EDT 2015 resources/css/hello.css 0 Fri Aug 28 14:47:30 EDT 2015 META-INF/maven/ 0 Fri Aug 28 14:47:30 EDT 2015 META-INF/maven/org.jboss.quickstarts.eap/ 0 Fri Aug 28 14:47:30 EDT 2015 META-INF/maven/org.jboss.quickstarts.eap/jboss-websocket-hello/ 3396 Tue Aug 25 13:10:20 EDT 2015 META-INF/maven/org.jboss.quickstarts.eap/jboss-websocket-hello/pom.xml 140 Fri Aug 28 14:47:30 EDT 2015 META-INF/maven/org.jboss.quickstarts.eap/jboss-websocket-hello/pom.properties > Also, if you try to access the original address > http://localhost:8080/jboss-websocket-hello/ (or also > http://localhost:8080/jboss-websocket-hello/index.html) it should > now return 404. Is that so? Yes, both of those routes result in a 404. I pushed my changes to https://github.com/tobias/jboss-eap-quickstarts/commits/websocket-at-root, in case you want to try with that version. All of my changes are in this commit: https://github.com/tobias/jboss-eap-quickstarts/commit/a4cdaba614c794a26064b2523144e8db244abd98 Hmm, it works only with the URL ending with a slash character: var wsURI = 'ws://' + window.location.host + '/jboss-websocket-hello/'; doesn't work without slash: var wsURI = 'ws://' + window.location.host + '/jboss-websocket-hello'; I would say it's OK though, because response is 302 with location header set to http://localhost:8080/jboss-websocket-hello/, so browser would normally follow this redirection. Apparently, websockets don't follow redirections, they fail if they get anything else than 101. That makes sense, thanks. |