查看tomcat服务器返回的响应消息,Tomcat上的WebSocket握手返回意外响应代码500

我有一个WebSocket应用程序,该程序以编程方式注册了端点,而没有使用注释。

相关代码为:ServerEndpointConfig.Configurator configurator =

(ServerEndpointConfig.Configurator)configuratorClass.newInstance();

ServerEndpointConfig serverEndpointConfig = ServerEndpointConfig.Builder

.create(endpointClass, endpointPath)

.configurator(configurator)

.build();

ServerContainer serverContainer = (ServerContainer)app

.getServletContext()

.getAttribute("javax.websocket.server.ServerContainer");

serverContainer.addEndpoint(serverEndpointConfig);

当我在带有嵌入式Jetty容器的IDE中运行它时,一切工作正常,其中依赖关系通过Maven在tomcat-websocket和tomcat-websocket-api库上,但是当我在Tomcat(8.5.5)中部署它,然后尝试建立WebSocket连接,在浏览器的控制台中出现以下错误:WebSocket与“ ws://127.0.0.1:8080 / echo”的连接失败:WebSocket握手期间出错:意外的响应代码:500

我在Catalina输出中未记录任何错误或其他信息,并且不确定如何调试此问题。

我需要以编程方式配置端点,因为在编译时尚不了解许多信息,因此请不要将我指向注释解决方案。

我已将日志级别设置为FINE,这是相关的代码段:T.550 FINE [http-nio-IP-Acceptor-0] o.a.tomcat.util.threads.LimitLatch.countUpOrAwait Counting up[http-nio-IP-Acceptor-0] latch=2

T.551 FINE [http-nio-IP-exec-3] o.a.coyote.AbstractProtocol$ConnectionHandler.process Processing socket [o.a.tomcat.util.net.NioChannel@1e87b268:java.nio.channels.SocketChannel[connected local=/192.168.1.17:8080 remote=/192.168.1.17:51259]] with status [OPEN_READ]

T.551 FINE [http-nio-IP-exec-3] o.a.coyote.http11.Http11InputBuff

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值