title: Spring JMS Listener doesnt connect to ActiveMQ
body: <p>i want to use the Spring JMSListener infrastructure. So i set up an ActiveMQ instance and tried to do a simple test. Here is my spring config:</p>
  
  <pre><code>   &lt;!-- ActiveMQ Configuration --&gt;
      &lt;jms:annotation-driven/&gt;
  
      &lt;!-- JMS ConnectionFactory to use, configuring the embedded broker using XML --&gt;
      &lt;bean id="jmsConnectionFactory" class="org.apache.activemq.spring.ActiveMQConnectionFactory"&gt;
          &lt;property name="brokerURL" value="tcp://xxxx.xxxx.net:8161" /&gt;
      &lt;/bean&gt;
  
  
      &lt;bean id="jmsListenerContainerFactory"
            class="org.springframework.jms.config.DefaultJmsListenerContainerFactory"&gt;
          &lt;property name="connectionFactory" ref="jmsConnectionFactory"/&gt;
          &lt;property name="concurrency" value="3-10"/&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>Of course i have a simple class like this:</p>
  
  <pre><code>@Component
  public class MessageListenerExample {
  
      @JmsListener(destination = "TestQueue")
      public void doSomething(String message) {
          System.out.println("OnMessage Received  :" + message);
  
      }
  }
  </code></pre>
  
  <p>Now when i startup the spring based application. i see in the debugger that my listener methods gets registered but somehow Spring doesnt connect to the ActiveMQ queue, which i can see easily by looking in the activeMQ web console. Furthermore i dont see any logging output from spring what the JMS stuff does. </p>
  
  <p>Do i miss something? Whats the best way to go from here? Of course i also tested to send a message from within the web console of ActiveMQ but w/o a client connection, there is no hope of delivery. Thanks for any input.</p>
  
  <hr>
  
  <p><strong>Update:</strong> i found a stacktrace...</p>
  
  <pre><code>[WARN 14:02:58] DefaultMessageListenerContainer.handleListenerSetupFailure(860) | Setup of JMS message listener invoker failed for destination 'TestQueue' - trying to recover. Cause: The JMS connection has failed: Unknown data type: 47
  org.apache.activemq.ConnectionFailedException: The JMS connection has failed: Unknown data type: 47
      at org.apache.activemq.ActiveMQConnection.checkClosedOrFailed(ActiveMQConnection.java:1480)
      at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:324)
      at org.springframework.jms.support.JmsAccessor.createSession(JmsAccessor.java:192)
      at org.springframework.jms.listener.DefaultMessageListenerContainer.access$1400(DefaultMessageListenerContainer.java:122)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.initResourcesIfNecessary(DefaultMessageListenerContainer.java:1162)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1141)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1134)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1031)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.io.IOException: Unknown data type: 47
      at org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireFormat.java:365)
      at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:285)
      at org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:221)
      at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:213)
      at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196)
      ... 1 more
  </code></pre>