title: Use Camel recipientList got ClassCastException
body: <p>I'm trying to use Apache Camel to dynamically specify destination when program running. After changing the recipientList parameter to List of Endpoint will encounter a ClassCastException. </p>
  
  <p>Could anyone who can help to advice if I have missed something?</p>
  
  <p>Thanks a lot.</p>
  
  <pre><code>from("jms:queue:jms/XXXQ").recipientList(header("recipientList")); 
  
  List&lt;Endpoint&gt; eps = new ArrayList&lt;Endpoint&gt;(); 
  CxfEndpoint endpoint = exchange.getContext().getEndpoint("cxf:bean:configServiceEndpoint", CxfEndpoint.class);
  
  endpoint.setAddress(URL);
  endpoint.setWsdlURL(WSDL);
  eps.add(endpoint); 
  
  CxfProducer cp = (CxfProducer) endpoint.createProducer();
  cp.start();  
  
  exchange.getIn().setHeader("recipientList", eps);
  
  &lt;cxf:cxfEndpoint id="configServiceEndpoint" address="${CXFTestSupport.URL}" wsdlURL="${CXFTestSupport.WSDL}" serviceClass="com.company.client.ClientService"&gt;
  &lt;/cxf:cxfEndpoint&gt;
  </code></pre>
  
  <p>The exception as the following:</p>
  
  <pre><code>2017-05-16 09:24:16,100 13100 WARN  org.apache.camel.component.jms.EndpointMessageListener  - Execution of JMS message listener failed. Caused by: [org.apache.camel.RuntimeCamelException - java.lang.ClassCastException: org.apache.camel.component.cxf.CxfSpringEndpoint incompatible with java.lang.String]
  org.apache.camel.RuntimeCamelException: java.lang.ClassCastException: org.apache.camel.component.cxf.CxfSpringEndpoint incompatible with java.lang.String
          at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1619)
          at org.apache.camel.component.jms.EndpointMessageListener$EndpointMessageListenerAsyncCallback.done(EndpointMessageListener.java:186)
          at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:107)
          at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:699)
          at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:637)
          at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:605)
          at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:308)
          at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:246)
          at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1144)
          at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1136)
          at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1033)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)
          at java.lang.Thread.run(Thread.java:809)
      Caused by: java.lang.ClassCastException: org.apache.camel.component.cxf.CxfSpringEndpoint incompatible with java.lang.String
          at org.apache.cxf.transport.http.Headers.transferProtocolHeadersToURLConnection(Headers.java:358)
          at org.apache.cxf.transport.http.Headers.setProtocolHeadersInConnection(Headers.java:310)
          at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.setProtocolHeaders(URLConnectionHTTPConduit.java:222)
          at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1288)
          at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1267)
          at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:210)
          at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47)
          at org.apache.cxf.io.AbstractThresholdOutputStream.unBuffer(AbstractThresholdOutputStream.java:89)
          at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:63)
          at org.apache.cxf.io.CacheAndWriteOutputStream.write(CacheAndWriteOutputStream.java:80)
          at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:51)
          at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:100)
          at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:241)
          at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:253)
          at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:215)
          at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:174)
          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
          at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:516)
          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:418)
          at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:116)
          at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:91)
          at org.apache.camel.builder.NoErrorHandlerBuilder$1.process(NoErrorHandlerBuilder.java:40)
          at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
          at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
          at org.apache.camel.processor.MulticastProcessor.doProcessParallel(MulticastProcessor.java:798)
          at org.apache.camel.processor.MulticastProcessor.access$200(MulticastProcessor.java:83)
          at org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:304)
          at org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:289)
          at java.util.concurrent.FutureTask.run(FutureTask.java:274)
          ... 3 more
      2017-05-16 09:24:16,100 13100 WARN  org.apache.camel.component.jms.EndpointMessageListener  - Execution of JMS message listener failed. Caused by: [org.apache.camel.RuntimeCamelException - java.lang.ClassCastException: org.apache.camel.component.cxf.CxfSpringEndpoint incompatible with java.lang.String]
      org.apache.camel.RuntimeCamelException: java.lang.ClassCastException: org.apache.camel.component.cxf.CxfSpringEndpoint incompatible with java.lang.String
          at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1619)
          at org.apache.camel.component.jms.EndpointMessageListener$EndpointMessageListenerAsyncCallback.done(EndpointMessageListener.java:186)
          at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:107)
          at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:699)
          at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:637)
          at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:605)
          at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:308)
          at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:246)
          at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1144)
          at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1136)
          at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1033)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)
          at java.lang.Thread.run(Thread.java:809)
      Caused by: java.lang.ClassCastException: org.apache.camel.component.cxf.CxfSpringEndpoint incompatible with java.lang.String
          at org.apache.cxf.transport.http.Headers.transferProtocolHeadersToURLConnection(Headers.java:358)
          at org.apache.cxf.transport.http.Headers.setProtocolHeadersInConnection(Headers.java:310)
          at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.setProtocolHeaders(URLConnectionHTTPConduit.java:222)
          at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1288)
          at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1267)
          at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:210)
          at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47)
          at org.apache.cxf.io.AbstractThresholdOutputStream.unBuffer(AbstractThresholdOutputStream.java:89)
          at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:63)
          at org.apache.cxf.io.CacheAndWriteOutputStream.write(CacheAndWriteOutputStream.java:80)
          at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:51)
          at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:100)
          at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:241)
          at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:253)
          at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:215)
          at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:174)
          at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
          at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:516)
          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:418)
          at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:116)
          at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:91)
          at org.apache.camel.builder.NoErrorHandlerBuilder$1.process(NoErrorHandlerBuilder.java:40)
          at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
          at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
          at org.apache.camel.processor.MulticastProcessor.doProcessParallel(MulticastProcessor.java:798)
          at org.apache.camel.processor.MulticastProcessor.access$200(MulticastProcessor.java:83)
          at org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:304)
          at org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:289)
          at java.util.concurrent.FutureTask.run(FutureTask.java:274)
          ... 3 more
  </code></pre>