title: Camel JMS failed to create producer
body: <p>I am reasonably new to Camel and have been trying to use requestBody but keep getting an error.  I've simplified my code and still get the same exception.  If my guess is correct the key is probably the message 'Failed to create Producer for endpoint' but I'm not sure how to do that using the Java DSL.    </p>
  
  <p>Could someone please point me to the Camel documentation that shows me what I am doing wrong.  Thank you for your help.</p>
  
  <p>Here is the simplified code.</p>
  
  <pre><code>package nz.co.home.cameljmsrequest;
  
  import org.apache.camel.CamelContext;
  import org.apache.camel.ProducerTemplate;
  import org.apache.camel.component.activemq.ActiveMQComponent;
  import org.apache.camel.impl.DefaultCamelContext;
  
  public class App {
  
      public static void main(String[] args) throws Exception {
  
          // set up the underlying camel context and add the ActiveMQ component
          CamelContext camelContext = new DefaultCamelContext();
          camelContext.addComponent(
                  "jms",
                  ActiveMQComponent.activeMQComponent("tcp://192.168.1.150:61616")
                  );
  
          // start the context
          camelContext.start();
  
          // send the message
          ProducerTemplate producer = camelContext.createProducerTemplate();
          String requestBody = producer.requestBody("jms:queue:test", 
                  "Request Message", String.class);
          System.out.println(requestBody);
  
          // stop the context
          camelContext.stop();
  
          // just because we can
          System.out.println("sent message");
      }
  }
  </code></pre>
  
  <p>The resulting messages look like this:</p>
  
  <pre><code>Exception in thread "main" org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: Request Message]
      at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1287)
      at org.apache.camel.util.ExchangeHelper.extractResultBody(ExchangeHelper.java:618)
      at org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:454)
      at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:120)
      at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:136)
      at org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:284)
      at org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:314)
      at nz.co.home.cameljmsrequest.App.main(App.java:23)
  Caused by: org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: Endpoint[jms://queue:testCamelActiveMq]. Reason: java.lang.IllegalArgumentException: connectionFactory must be specified
      at org.apache.camel.component.jms.JmsProducer.initReplyManager(JmsProducer.java:98)
      at org.apache.camel.component.jms.JmsProducer.processInOut(JmsProducer.java:164)
      at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:129)
      at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
      at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
      at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
      at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
      at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63)
      at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:366)
      at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:337)
      at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:233)
      at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:337)
      at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:192)
      at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:115)
      at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:119)
      ... 4 more
  Caused by: java.lang.IllegalArgumentException: connectionFactory must be specified
      at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:290)
      at org.apache.camel.component.jms.JmsConfiguration.createConnectionFactory(JmsConfiguration.java:1052)
      at org.apache.camel.component.jms.JmsConfiguration.getConnectionFactory(JmsConfiguration.java:415)
      at org.apache.camel.component.jms.JmsEndpoint.getConnectionFactory(JmsEndpoint.java:468)
      at org.apache.camel.component.jms.reply.TemporaryQueueReplyManager.createListenerContainer(TemporaryQueueReplyManager.java:115)
      at org.apache.camel.component.jms.reply.ReplyManagerSupport.doStart(ReplyManagerSupport.java:222)
      at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
      at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:62)
      at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:52)
      at org.apache.camel.component.jms.JmsProducer.createReplyManager(JmsProducer.java:503)
      at org.apache.camel.component.jms.JmsProducer.initReplyManager(JmsProducer.java:94)
      ... 18 more
  </code></pre>