title: Spring RabbitMQ invalid listener
body: <p>I am new in Spring RabbitMQ. I am trying to send my ChatMesssage object to RabbitMQ, but during the configuration of RabbitMQ, i am getting that error below : </p>
  
  <blockquote>
    <p>org.springframework.amqp.rabbit.listener.exception.FatalListenerExecutionException: Invalid listener
        at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1142)
        at java.lang.Thread.run(Unknown Source)
    Caused by: org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Failed to invoke target method 'handleMessage' with argument type = [class [B], value = [{[B@6bced6b0}]
        at org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter.invokeListenerMethod(MessageListenerAdapter.java:348)
        at org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter.onMessage(MessageListenerAdapter.java:253)
        at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:756)
        at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:679)
        at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$001(SimpleMessageListenerContainer.java:83)
        at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$1.invokeListener(SimpleMessageListenerContainer.java:170)
        at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.invokeListener(SimpleMessageListenerContainer.java:1257)
        at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener</p>
  </blockquote>
  
  <p>RabbitConfiguration Class : </p>
  
  <pre><code>@Bean
  TopicExchange directExchange(){
      return new TopicExchange(MessagingBusNamespace.CHAT_MESSAGE_TOPIC_EXCHANGE);
  }
  
  @Bean
  Binding binding(final Queue queue, final Exchange exchange){
      return BindingBuilder.bind(queue).to(exchange).with(MessagingBusNamespace.ROUTE_KEY).noargs();
  }
  
  @Bean
  HTTPChatMessageReceiver receiver(){
      return new HTTPChatMessageReceiver();
  }
  
  @Bean
  MessageListenerAdapter messageListenerAdapter(){
      return new MessageListenerAdapter(receiver(), "handleMessage");
  }
  
  @Bean
  SimpleMessageListenerContainer simpleMessageListenerContainer(final ConnectionFactory connectionFactory,
                                                                       final MessageListenerAdapter messageListenerAdapter){
      SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
      container.setConnectionFactory(connectionFactory);
      container.setQueueNames(MessagingBusNamespace.CHAT_MESSAGE_QUEUE);
      container.setMessageListener(messageListenerAdapter);
      return container;
  }
  </code></pre>
  
  <p>handler class :</p>
  
  <pre><code>public class HTTPChatMessageReceiver {
  
     public HTTPChatMessageReceiver() {
      // TODO Auto-generated constructor stub
     }
  
     public void handleMessage(ChatMessage message) {
  
     }
  
  }
  </code></pre>