WebSocket handshake: Unexpected response code: 404 -

后端 未结 2 1453
礼貌的吻别
礼貌的吻别 2021-01-14 08:54

I am learning about websockets and followed the instructions here: http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/HomeWebsocket/WebsocketHome.html

I\

2条回答
  •  半阙折子戏
    2021-01-14 09:28

    The Error during the handshake happens, because Tomcat has its own api for websockets. Thus you might have added the JSR implementation or something similar as javax.websocket-api in your pom.xml there comes a conflict at runtime.

    Try to not export your Websocket-library to your webserver, thus it uses its own implementation.

    If you use maven, set the websocket dependency as provided:

    
    
        javax.websocket
        javax.websocket-api
        1.1
        provided
    
    

提交回复
热议问题