springboot打成war包后在tomcat运行报错。

旗木五五开 2017-05-23 11:45:03
Caused by: javax.websocket.DeploymentException: Multiple Endpoints may not be deployed to the same path [/websocket] : existing endpoint was class com.test.framework.websocket.WebsocketBase and new endpoint is class com.test.framework.websocket.WebsocketBase
at org.apache.tomcat.websocket.server.WsServerContainer.addEndpoint(WsServerContainer.java:180) ~[tomcat-embed-websocket-8.5.14.jar:8.5.14]
at org.apache.tomcat.websocket.server.WsServerContainer.addEndpoint(WsServerContainer.java:234) ~[tomcat-embed-websocket-8.5.14.jar:8.5.14]
at org.springframework.web.socket.server.standard.ServerEndpointExporter.registerEndpoint(ServerEndpointExporter.java:145) ~[spring-websocket-4.3.8.RELEASE.jar:4.3.8.RELEASE]
... 25 common frames omitted


在springboot上运行正常,但是生成war包后在tomcat下运行失败
...全文
544 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
橙叠 2017-07-05
  • 打赏
  • 举报
回复
楼主问题解决了没? 注释掉websocket的@Component ,websocket服务起不来啊??
旗木五五开 2017-06-05
  • 打赏
  • 举报
回复
引用 2 楼 qq_28639045 的回复:
现在很流行springboot啊
是啊,springboot确实很好用,非常方便,就是目前网上的资料还不是很多,有些奇葩的问题不好找。
旗木五五开 2017-06-05
  • 打赏
  • 举报
回复
引用 1 楼 aschouas 的回复:
少包,报错很清楚
其实并不是少包了,是因为在tomcat下有自己的websocket支持包,不需要spring来管理。所以在tomcat下运行的话需要注释掉websocket的@Component
  • 打赏
  • 举报
回复
现在很流行springboot啊
一个治疗术 2017-05-23
  • 打赏
  • 举报
回复
少包,报错很清楚

50,545

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧