title: "Cannot convert value of type" exception with Spring AMQP
body: <p>I'm trying to send message to my direct exchange on RabbitMQ server.</p>
  
  <p>I have queue named as "test_queue" and direct exchange with same name "test_queue" which is bound to the queue ""test_queue".</p>
  
  <p>I use Spring AMQP with XML configuration for interacting with Rabbit MQ, and here is my conf:</p>
  
  <pre><code>&lt;rabbit:template id="amqpTemplate"
                   connection-factory="rabbitConnectionFactory"
                   exchange="test_queue"/&gt;
  
  &lt;rabbit:admin connection-factory="rabbitConnectionFactory"/&gt;
  
  &lt;rabbit:queue name="test_queue"/&gt;
  
  &lt;rabbit:connection-factory id="rabbitConnectionFactory" (...)/&gt;
  
  &lt;rabbit:direct-exchange name="test_queue"&gt;
      &lt;rabbit:bindings&gt;
          &lt;rabbit:binding queue="test_queue"/&gt;
      &lt;/rabbit:bindings&gt;
  &lt;/rabbit:direct-exchange&gt;
  </code></pre>
  
  <p>And I'm trying to send message this way:</p>
  
  <pre><code>AbstractApplicationContext ctx = new ClassPathXmlApplicationContext("context.xml");
  RabbitTemplate template = (RabbitTemplate) ctx.getBean("amqpTemplate");
  template.convertAndSend("Hello, world!");
  </code></pre>
  
  <p>Exception which I got:</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.amqp.rabbit.config.BindingFactoryBean#0': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.amqp.core.DirectExchange' to required type 'org.springframework.amqp.core.Queue' for property 'destinationQueue'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.amqp.core.DirectExchange] to required type [org.springframework.amqp.core.Queue] for property 'destinationQueue': no matching editors or conversion strategy found
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:753)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:835)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:139)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:83)
      at rabbitmq.TestRabbitMq.main(TestRabbitMq.java:14)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
  Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.amqp.core.DirectExchange' to required type 'org.springframework.amqp.core.Queue' for property 'destinationQueue'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.amqp.core.DirectExchange] to required type [org.springframework.amqp.core.Queue] for property 'destinationQueue': no matching editors or conversion strategy found
      at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:591)
      at org.springframework.beans.AbstractNestablePropertyAccessor.convertForProperty(AbstractNestablePropertyAccessor.java:603)
      at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:204)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1527)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1486)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1226)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
      ... 16 more
  Caused by: java.lang.IllegalStateException: Cannot convert value of type [org.springframework.amqp.core.DirectExchange] to required type [org.springframework.amqp.core.Queue] for property 'destinationQueue': no matching editors or conversion strategy found
      at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:302)
      at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:576)
      ... 22 more
  </code></pre>