wd34zc 2017-05-05 07:44 采纳率: 0%
浏览 3701

java websocket html5 启动服务器时抛出异常

javax.servlet.ServletException: javax.websocket.DeploymentException: Multiple Endpoints may not be deployed to the same path [/websocket] : existing endpoint was class WebSocketTest and new endpoint is class html5.MyWebSocket
at org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.websocket.DeploymentException: Multiple Endpoints may not be deployed to the same path [/websocket] : existing endpoint was class WebSocketTest and new endpoint is class html5.MyWebSocket
at org.apache.tomcat.websocket.server.WsServerContainer.addEndpoint(WsServerContainer.java:225)
at org.apache.tomcat.websocket.server.WsServerContainer.addEndpoint(WsServerContainer.java:279)
at org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:120)
... 8 more

启动服务器时,信息中夹杂着这两个异常代码,什么意思呀?
  • 写回答

1条回答

  • N+1 2018-04-12 09:15
    关注

    假如你是用tomcat运行的话,如果你注入了
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
    return new ServerEndpointExporter();
    }
    并且使用了
    @ServerEndpoint()
    那么删除掉前者即可
    这是stackoverflow的解释
    https://stackoverflow.com/questions/31178799/websocket-issue-multiple-endpoints-may-not-be-deployed-to-the-same-path

    评论

报告相同问题?

悬赏问题

  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥15 绘制多分类任务的roc曲线时只画出了一类的roc,其它的auc显示为nan
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?