0

嗨,我在 websockets 和 spring 4 和 tomcat 7 上遇到了以下问题。我在 tomcat 上部署了应用程序,当我尝试让 websocket 工作时,出现以下错误。

任何人都对我的冲突在哪里有任何想法,我知道它是一个 Maven 依赖问题,一直在遍历层次结构......

java.lang.NoSuchMethodError: org.springframework.web.socket.WebSocketSession.getAttributes()Ljava/util/Map;
    at com.ingg.virgo.connection.sockjs.messagehandler.VirgoSockJSTextWebSocketHandler.handleTextMessage(VirgoSockJSTextWebSocketHandler.java:84) ~[VirgoSockJSTextWebSocketHandler.class:na]
    at org.springframework.web.socket.handler.AbstractWebSocketHandler.handleMessage(AbstractWebSocketHandler.java:43) [spring-websocket-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.web.socket.handler.PerConnectionWebSocketHandler.handleMessage(PerConnectionWebSocketHandler.java:84) ~[spring-websocket-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.web.socket.handler.WebSocketHandlerDecorator.handleMessage(WebSocketHandlerDecorator.java:59) ~[spring-websocket-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.web.socket.handler.LoggingWebSocketHandlerDecorator.handleMessage(LoggingWebSocketHandlerDecorator.java:55) ~[spring-websocket-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.web.socket.handler.ExceptionWebSocketHandlerDecorator.handleMessage(ExceptionWebSocketHandlerDecorator.java:69) ~[spring-websocket-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.delegateMessages(AbstractSockJsSession.java:153) [spring-websocket-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.web.socket.sockjs.transport.session.WebSocketServerSockJsSession.handleMessage(WebSocketServerSockJsSession.java:154) [spring-websocket-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.web.socket.sockjs.transport.handler.SockJsWebSocketHandler.handleTextMessage(SockJsWebSocketHandler.java:77) [spring-websocket-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.web.socket.handler.AbstractWebSocketHandler.handleMessage(AbstractWebSocketHandler.java:43) [spring-websocket-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.handleTextMessage(StandardWebSocketHandlerAdapter.java:112) [spring-websocket-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.access$000(StandardWebSocketHandlerAdapter.java:42) [spring-websocket-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:82) [spring-websocket-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:79) [spring-websocket-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:369) [tomcat7-websocket.jar:7.0.47]
    at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:468) [tomcat7-websocket.jar:7.0.47]
    at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:272) [tomcat7-websocket.jar:7.0.47]
    at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:116) [tomcat7-websocket.jar:7.0.47]
    at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:54) [tomcat7-websocket.jar:7.0.47]
    at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:192) [tomcat7-websocket.jar:7.0.47]
    at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:178) [tomcat-coyote.jar:7.0.47]
    at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:92) [tomcat-coyote.jar:7.0.47]
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:601) [tomcat-coyote.jar:7.0.47]
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) [tomcat-coyote.jar:7.0.47]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_03]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_03]
    at java.lang.Thread.run(Unknown Source) [na:1.7.0_03]
4

1 回答 1

0

发现问题与 servlet-api 不在 3.1 有关

于 2014-07-11T13:34:14.893 回答