Bug 57676 - WebSocket check same path endpoint implementation enhancement
Summary: WebSocket check same path endpoint implementation enhancement
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: WebSocket (show other bugs)
Version: 8.0.5
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-09 02:10 UTC by yangkun
Modified: 2015-06-01 12:07 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yangkun 2015-03-09 02:10:30 UTC
If there are two websocket endpoint has same path, eg, path is "/",Tomcat start will report the following errors:

Multiple Endpoints may not be deployed to the same path [/]
...

  But the errors info can't provide us more enough info.We can't know which the two endpoints.If so,we may need to search texts,I think not very convenient.
  If report the following errors info, we can know which two endpoints:

Multiple Endpoints may not be deployed to the same path [/], the first endpoint is [echo.EchoServer], the second endpoint is [echo.annoted.EchoServer]

  
  The simple way is to modify WsServerContainer#addEndpoint() method and org/apache/tomcat/websocket/server/LocalStrings.properties.

  example:

#serverContainer.duplicatePaths=Multiple Endpoints may not be deployed to the same path [{0}]
serverContainer.duplicatePaths=Multiple Endpoints may not be deployed to the same path [{0}], the first endpoint is [{1}], the second endpoint is [{2}]


if (old != null) {
// Duplicate path mappings
	throw new DeploymentException(sm.getString("serverContainer.duplicatePaths", path, old.getEndpointClass().getName(), sec.getEndpointClass().getName()));
}
Comment 1 Christopher Schultz 2015-03-09 16:31:00 UTC
Fixed in trunk in r1665292 and Tomcat 8.0.x in r1665296.
Will be in Tomcat 8.0.21.
Comment 2 Christopher Schultz 2015-03-09 16:36:54 UTC
Note that I do not intend to back-port this to Tomcat 7 unless someone requests it.
Comment 3 Violeta Georgieva 2015-06-01 12:07:25 UTC
Fixed in Tomcat 7 trunk and will be in 7.0.63 onwards.