websockets和spring 4以及tomcat 7没有这样的方法问题

时间:2014-07-10 09:48:30

标签: spring tomcat7 sockjs spring-websocket

我正在使用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]

1 个答案:

答案 0 :(得分:0)

发现问题与servlet-api不在3.1

有关