Project: Tomcat
Bug 54807 [jsr356] java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer$TemplatePathMatch
Reported: 2013-04-05 15:38:39 | Status: resolved fixed

Caused by: java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer$TemplatePathMatch cannot be cast to java.lang.Comparable at java.util.TreeMap.compare(TreeMap.java:1188) at java.util.TreeMap.put(TreeMap.java:531) at java.util.TreeSet.add(TreeSet.java:255) at org.apache.tomcat.websocket.server.WsServerContainer.addEndpoint(WsServerContainer.java:144) at org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:118) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5195) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 11 more Reproducible when a path is defined as {path}. For example: @Override public Set<ServerEndpointConfig> getEndpointConfigs(Set<Class<? extends Endpoint>> endpointClasses) { logger.debug("{} detected", JSR356ServerEndpointConfig.class.getName()); return new HashSet<ServerEndpointConfig>() {{ add(ServerEndpointConfig.Builder.create(JSR356Endpoint.class, "/{path}").configurator(c).build()); }}; }

Files changed in fix:
java/org/apache/tomcat/websocket/server/WsServerContainer.java test/org/apache/tomcat/websocket/server/TestWebSocketServerContainer.java