title: Connect to a queue on JBoss EAP6 from Camel
body: <p>I have a HornetQ JMS queue set on JBoss EAP6, in the standalone.xml file.</p>
  <pre><code>&lt;hornetq-server&gt;
  [...]
      &lt;jms-connection-factories&gt;
          &lt;connection-factory name=&quot;RemoteConnectionFactory&quot;&gt;
              &lt;connectors&gt;
                  &lt;connector-ref connector-name=&quot;netty&quot;/&gt;
              &lt;/connectors&gt;
              &lt;entries&gt;
                  &lt;entry name=&quot;java:jboss/exported/jms/RemoteConnectionFactory&quot;/&gt;
              &lt;/entries&gt;
          &lt;/connection-factory&gt;
      &lt;/jms-connection-factories&gt;
  
      &lt;jms-destinations&gt;
          &lt;jms-queue name=&quot;WorkflowExecution&quot;&gt;
              &lt;entry name=&quot;/queue/MyQueue&quot;/&gt;
              &lt;entry name=&quot;java:jboss/exported/queue/MyQueue&quot;/&gt;
          &lt;/jms-queue&gt;
      &lt;/jms-destinations&gt;
  &lt;/hornetq-server&gt;
  </code></pre>
  <p>The queue works fine, and I can send messages on it using tools like Hermes JMS.</p>
  <p>I'm working on a standalone client application, running in Fuse 4.4, that has to send a message to the queue via a Camel route but I can't figure out how to set the connector in the configuration.</p>
  <p>This is what I tried to set in the camel-context.xml file:</p>
  <pre><code>&lt;bean id=&quot;jmsinjection&quot; class=&quot;org.apache.camel.component.jms.JmsComponent&quot;&gt;
    &lt;property name=&quot;connectionFactory&quot;&gt;
      &lt;bean class=&quot;org.springframework.jndi.JndiObjectFactoryBean&quot;&gt;
        &lt;property name=&quot;jndiName&quot; value=&quot;jms/RemoteConnectionFactory&quot; /&gt;
        &lt;property name=&quot;jndiEnvironment&quot;&gt;
          &lt;props&gt;
            &lt;prop key=&quot;java.naming.provider.url&quot;&gt;remote://myEAPurl:port&lt;/prop&gt;
            &lt;prop key=&quot;java.naming.factory.initial&quot;&gt;org.jboss.naming.remote.client.InitialContextFactory&lt;/prop&gt;
          &lt;/props&gt;
        &lt;/property&gt;
      &lt;/bean&gt;
    &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  <p>And the exception I get:</p>
  <blockquote>
  <p>Error creating bean with name 'jmsinjection' defined in URL [bundle://79.37:0/META-INF/spring/camel-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.hornetq.jms.client.HornetQJMSConnectionFactory' to required type 'javax.jms.ConnectionFactory' for property 'connectionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.hornetq.jms.client.HornetQJMSConnectionFactory] to required type [javax.jms.ConnectionFactory] for property 'connectionFactory': no matching editors or conversion strategy found</p>
  </blockquote>
  <p>According to the javadoc, <code>HornetQJMSConnectionFactory</code> implements <code>javax.jms.QueueConnectionFactory</code> which extends <code>javax.jms.ConnectionFactory</code>, so I don't get why I get this exception.</p>
  <p>I spent hours scraping JBoss forum and doc but can't find a way to make it work.</p>
  <p>What is wrong in my camel configuration? How to fix it?</p>