org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stompWebSocketHandlerMapping' defined in class path resource [org/springframework/web/socket/config/annotation/DelegatingWebSocketMessageBrokerConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'stompWebSocketHandlerMapping' threw exception; nested exception is java.lang.AbstractMethodError: org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer$SessionStompEndpointRegistry.setErrorHandler(Lorg/springframework/web/socket/messaging/StompSubProtocolErrorHandler;)Lorg/springframework/web/socket/config/annotation/WebMvcStompEndpointRegistry;

Stack Overflow | Rafik991 | 7 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Strange spring error with websocket configuration

    Stack Overflow | 7 months ago | Rafik991
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stompWebSocketHandlerMapping' defined in class path resource [org/springframework/web/socket/config/annotation/DelegatingWebSocketMessageBrokerConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'stompWebSocketHandlerMapping' threw exception; nested exception is java.lang.AbstractMethodError: org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer$SessionStompEndpointRegistry.setErrorHandler(Lorg/springframework/web/socket/messaging/StompSubProtocolErrorHandler;)Lorg/springframework/web/socket/config/annotation/WebMvcStompEndpointRegistry;

    Root Cause Analysis

    1. java.lang.AbstractMethodError

      org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer$SessionStompEndpointRegistry.setErrorHandler(Lorg/springframework/web/socket/messaging/StompSubProtocolErrorHandler;)Lorg/springframework/web/socket/config/annotation/WebMvcStompEndpointRegistry;

      at com.sportech.g440.websocket.config.WebSocketConfig.configureStompEndpoints()
    2. com.sportech.g440
      WebSocketConfig.configureStompEndpoints
      1. com.sportech.g440.websocket.config.WebSocketConfig.configureStompEndpoints(WebSocketConfig.java:66)
      1 frame
    3. org.springframework.session
      AbstractSessionWebSocketMessageBrokerConfigurer.registerStompEndpoints
      1. org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer.registerStompEndpoints(AbstractSessionWebSocketMessageBrokerConfigurer.java:90)
      1 frame
    4. Spring WebSocket
      DelegatingWebSocketMessageBrokerConfiguration$$EnhancerBySpringCGLIB$$c336deb2$$FastClassBySpringCGLIB$$b4488daf.invoke
      1. org.springframework.web.socket.config.annotation.DelegatingWebSocketMessageBrokerConfiguration.registerStompEndpoints(DelegatingWebSocketMessageBrokerConfiguration.java:59)
      2. org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurationSupport.stompWebSocketHandlerMapping(WebSocketMessageBrokerConfigurationSupport.java:78)
      3. org.springframework.web.socket.config.annotation.DelegatingWebSocketMessageBrokerConfiguration$$EnhancerBySpringCGLIB$$c336deb2.CGLIB$stompWebSocketHandlerMapping$10(<generated>)
      4. org.springframework.web.socket.config.annotation.DelegatingWebSocketMessageBrokerConfiguration$$EnhancerBySpringCGLIB$$c336deb2$$FastClassBySpringCGLIB$$b4488daf.invoke(<generated>)
      4 frames
    5. Spring Core
      MethodProxy.invokeSuper
      1. org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
      1 frame
    6. Spring Context
      ConfigurationClassEnhancer$BeanMethodInterceptor.intercept
      1. org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:355)
      1 frame
    7. Spring WebSocket
      DelegatingWebSocketMessageBrokerConfiguration$$EnhancerBySpringCGLIB$$c336deb2.stompWebSocketHandlerMapping
      1. org.springframework.web.socket.config.annotation.DelegatingWebSocketMessageBrokerConfiguration$$EnhancerBySpringCGLIB$$c336deb2.stompWebSocketHandlerMapping(<generated>)
      1 frame
    8. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    9. Spring Beans
      SimpleInstantiationStrategy.instantiate
      1. org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
      1 frame