查看tomcat服务器返回的响应消息,Tomcat上的WebSocket握
⼿返回意外响应代码500
我有⼀个WebSocket应⽤程序,该程序以编程⽅式注册了端点,⽽没有使⽤注释。
相关代码为:ServerEndpointConfig.Configurator configurator =
(ServerEndpointConfig.wInstance();
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]
at.util.untUpOrAwait Counting up[http-nio-IP-Acceptor-0] latch=2
T.551 FINE [http-nio-IP-exec-3] AbstractProtocol$ConnectionHandler.process Processing socket
[at.util.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] http11.Http11InputBuffer.parseRequestLine Received [GET /echo HTTP/1.1
Host: 192.168.1.17:8080
Connection: Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
Sec-WebSocket-Version: 13
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) C
hrome/54.0.2840.99 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Cookie: LUCEE_ADMIN_LANG=en; cfid=de1b0016-ad0c-4601-b8ce-ecb47771b9c8; cftoken=0;
LUCEE_ADMIN_LASTPAGE=debugging.logs
Sec-WebSocket-Key: Ogg0VPp9O3XZlR8rrgz4Gg==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
]
T.553 FINE [http-nio-IP-exec-3] at.util.http.Rfc6265CookieProcessor.parseCookieHeader Cookies: Parsing b[]: LUCEE_ADMIN_LANG=en; cfid=de1b0016-ad0c-4601-b8ce-ecb47771b9c8; cftoken=0;
LUCEE_ADMIN_LASTPAGE=debugging.logs
T.554 FINE [http-nio-IP-exec-3] o.a.catalina.authenticator.AuthenticatorBase.invoke Security checking request GET /echo
T.554 FINE [http-nio-IP-exec-3] o.alm.RealmBase.findSecurityConstraints No applicable constraints defined
T.554 FINE [http-nio-IP-exec-3] o.a.catalina.authenticator.AuthenticatorBase.invoke Not subject to any constraint
T.561 FINE [http-nio-IP-exec-3] at.util.http.Parameters.setEncoding Set encoding to ISO-8859-1
T.563 FINE [http-nio-IP-exec-3] o.a.catalina.loader.WebappClassLoaderBase.loadClass
loadClass(llections.LocalStrings, false)
T.563 FINE [http-nio-IP-exec-3] o.a.catalina.loader.WebappClassLoaderBase.loadClass Delegating to parent classloader1 java.URLClassLoader@31befd9f
T.563 FINE [http-nio-IP-exec-3] o.a.catalina.loader.WebappClassLoaderBase.loadClass Searching local repositories
T.563 FINE [http-nio-IP-exec-3] o.a.catalina.loader.WebappClassLoaderBase.findClass
findClass(llections.LocalStrings)
T.564 FINE [http-nio-IP-exec-3] o.a.catalina.loader.WebappClassLoaderBase.findClass --> Returning ClassNotFoundException
T.564 FINE [http-nio-IP-exec-3] o.a.catalina.ResourceAsStream
getResourceAsStream(org/apache/tomcat/util/collections/LocalStrings.properties)
T.564 FINE [http-nio-IP-exec-3] o.a.catalina.ResourceAsStream Delegating to parent classloader java.URLClassLoader@31befd9f
T.565 FINE [http-nio-IP-exec-3] o.a.catalina.ResourceAsStream Searching local repositories
T.565 FINE [http-nio-IP-exec-3] o.a.catalina.ResourceAsStream --> Resource not found, returning null
T.566 FINE [http-nio-IP-exec-3] o.a.catalina.loader.WebappClassLoaderBase.loadClass
loadClass(llections.LocalStrings_en, false)
T.566 FINE [http-nio-IP-exec-3] o.a.catalina.loader.WebappClassLoaderBase.loadClass Delegating to parent classloader1 java.URLClassLoader@31befd9f
T.567 FINE [http-nio-IP-exec-3] o.a.catalina.loader.WebappClassLoaderBase.loadClass Searching local repositories
T.567 FINE [http-nio-IP-exec-3] o.a.catalina.loader.WebappClassLoaderBase.findClass
findClass(llections.LocalStrings_en)
T.568 FINE [http-nio-IP-exec-3] o.a.catalina.loader.WebappClassLoaderBase.findClass --> Returning ClassNotFoundException
T.569 FINE [http-nio-IP-exec-3] o.a.catalina.ResourceAsStream
getResourceAsStream(org/apache/tomcat/util/collections/LocalStrings_en.properties)
T.569 FINE [http-nio-IP-exec-3] o.a.catalina.ResourceAsStream Delegating to parent classloader java.URLClassLoader@31befd9f
T.570 FINE [http-nio-IP-exec-3] o.a.catalina.ResourceAsStream Searching local
repositories
T.571 FINE [http-nio-IP-exec-3] o.a.catalina.ResourceAsStream --> Resource not found, returning null
T.571 FINE [http-nio-IP-exec-3] o.a.catalina.loader.WebappClassLoaderBase.loadClass
loadClass(llections.LocalStrings_en_US, false)
T.571 FINE [http-nio-IP-exec-3] o.a.catalina.loader.WebappClassLoaderBase.loadClass Delegating to parent classloader1
java.URLClassLoader@31befd9f
T.572 FINE [http-nio-IP-exec-3] o.a.catalina.loader.WebappClassLoaderBase.loadClass Searching local repositoriesservlet和tomcat的关系
T.572 FINE [http-nio-IP-exec-3] o.a.catalina.loader.WebappClassLoaderBase.findClass
findClass(llections.LocalStrings_en_US)
T.573 FINE [http-nio-IP-exec-3] o.a.catalina.loader.WebappClassLoaderBase.findClass --> Returning
ClassNotFoundException
T.573 FINE [http-nio-IP-exec-3] o.a.catalina.ResourceAsStream
getResourceAsStream(org/apache/tomcat/util/collections/LocalStrings_en_US.properties)
T.573 FINE [http-nio-IP-exec-3] o.a.catalina.ResourceAsStream Delegating to parent
classloader java.URLClassLoader@31befd9f
T.574 FINE [http-nio-IP-exec-3] o.a.catalina.ResourceAsStream Searching local
repositories
T.574 FINE [http-nio-IP-exec-3] o.a.catalina.ResourceAsStream -
-> Resource not found, returning null
T.581 FINE [http-nio-IP-exec-3] AbstractProcessorLight.process Socket:
[at.util.NioEndpoint$NioSocketWrapper@6689cfeb:at.util.NioChannel@1e87b268:java.nio.channels.SocketC local=/192.168.1.17:8080 remote=/192.168.1.17:51259]], Status in: [OPEN_READ], State out: [CLOSED]
T.582 FINE [http-nio-IP-exec-3] at.util.untDown Counting down[http-nio-IP-exec-3] latch=2
T.114 FINE [http-nio-IP-exec-4] AbstractProtocol$ConnectionHandler.process Processing socket
[at.util.NioChannel@406eaa39:java.nio.channels.SocketChannel[connected local=/192.168.1.17:8080
remote=/192.168.1.17:51254]] with status [ERROR]
T.115 FINE [http-nio-IP-exec-4] at.util.untDown Counting down[http-nio-IP-exec-4] latch=1
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论