title: org.springframework.messaging.converter.MessageConversionException: No converter found from actual payload type 'byte[]' to expected payload
body: <p>I have a spring boot application , using @EnableJMS in configuration class and @JMSListener in listener class</p>
  <p>In configuration class i have created a bean for connection Factory and a bean for message converter</p>
  <p>something like this:</p>
  <pre><code>@Bean // Serialize message content to json using TextMessage
    public MessageConverter jacksonJmsMessageConverter() {
      MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
      converter.setTargetType(MessageType.TEXT);
      converter.setTypeIdPropertyName(&quot;_type&quot;);
      return converter;
    }
  
     
  </code></pre>
  <p>My listener class looks like this:</p>
  <pre><code>@Component
  public class Receiver {
  
    @JmsListener(destination = &quot;abcqueue&quot;, containerFactory = &quot;myFactory&quot;)
    public void receiveMessage(Message&lt;MyModel&gt; mymodel) {
      System.out.println(&quot;Received &lt;&quot;);
    }
  
  }
  </code></pre>
  <p>Error message:</p>
  <pre><code>; nested exception is org.springframework.messaging.converter.MessageConversionException: No converter found from actual payload type 'byte[]' to expected payload type 'com.model.MyModel', failedMessage=org.springframework.jms.listener.adapter.AbstractAdaptableMessageListener$MessagingMessageConverterAdapter$LazyResolutionMessage@3e8728
      at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:118) ~[spring-jms-5.1.8.RELEASE.jar:5.1.8.RELEASE]
      at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.onMessage(MessagingMessageListenerAdapter.java:77) ~[spring-jms-5.1.8.RELEASE.jar:5.1.8.RELEASE]
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:736) ~[spring-jms-5.1.8.RELEASE.jar:5.1.8.RELEASE]
      at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:696) [spring-jms-5.1.8.RELEASE.jar:5.1.8.RELEASE]
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:674) [spring-jms-5.1.8.RELEASE.jar:5.1.8.RELEASE]
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:318) [spring-jms-5.1.8.RELEASE.jar:5.1.8.RELEASE]
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:257) [spring-jms-5.1.8.RELEASE.jar:5.1.8.RELEASE]
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1189) [spring-jms-5.1.8.RELEASE.jar:5.1.8.RELEASE]
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1179) [spring-jms-5.1.8.RELEASE.jar:5.1.8.RELEASE]
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1076) [spring-jms-5.1.8.RELEASE.jar:5.1.8.RELEASE]
      at java.lang.Thread.run(Thread.java:748) [?:1.8.0_251]
  Caused by: org.springframework.messaging.converter.MessageConversionException: No converter found from actual payload type 'byte[]' to expected payload type MyModel'
      at org.springframework.messaging.handler.annotation.support.MessageMethodArgumentResolver.convertPayload(MessageMethodArgumentResolver.java:135) ~[spring-messaging-5.1.8.RELEASE.jar:5.1.8.RELEASE]
      at org.springframework.messaging.handler.annotation.support.MessageMethodArgumentResolver.resolveArgument(MessageMethodArgumentResolver.java:93) ~[spring-messaging-5.1.8.RELEASE.jar:5.1.8.RELEASE]
      at org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:117) ~[spring-messaging-5.1.8.RELEASE.jar:5.1.8.RELEASE]
      at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:148) ~[spring-messaging-5.1.8.RELEASE.jar:5.1.8.RELEASE]
      at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:116) ~[spring-messaging-5.1.8.RELEASE.jar:5.1.8.RELEASE]
      at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:114) ~[spring-jms-5.1.8.RELEASE.jar:5.1.8.RELEASE]
  </code></pre>