Skip to content

Exception when connect to a Websocket #276

Closed
@rafaelhz

Description

@rafaelhz

I'm using Spring Cloud Sleuth in some projects and everything is working well. But in a project where I have a websocket, an exception is thrown when connected to the websocket.

To simulate the error, clone the spring websocket demo app:
https://github.com/spring-guides/gs-messaging-stomp-websocket

After just include the dependency: (Without the dependency everything works)

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-sleuth</artifactId>
            <version>1.0.0.RELEASE</version>
        </dependency>

After run the application, connect to the websocket, you will see the exception:

Exception in thread "clientInboundChannel-2" org.springframework.messaging.MessageDeliveryException: Failed to handle GenericMessage [...]; nested exception is java.lang.IllegalStateException: No header accessor (not using the SimpMessagingTemplate?): GenericMessage [...]

Caused by: java.lang.IllegalStateException: No header accessor (not using the SimpMessagingTemplate?): GenericMessage [...]
at org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler.handleMessageInternal(SimpleBrokerMessageHandler.java:228)
    at org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler.handleMessage(AbstractBrokerMessageHandler.java:238)
    at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:135)
    ... 3 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions