title: Creating CSV file using apache camel spring
body: <p>I'm trying to create csv file from camel spring but getting error.Following is the code I have developed-</p>
  
  <pre><code>    &lt;from uri="quartz2://myqyartz?cron=cronexpr"/&gt;
      &lt;to uri="bean:TestProcessor" /&gt;
      &lt;marshal&gt;
      &lt;csv&gt; 
      &lt;header&gt;orderId&lt;/header&gt;
      &lt;header&gt;amount&lt;/header&gt;
      &lt;header&gt;amount2&lt;/header&gt;
      &lt;header&gt;amount3&lt;/header&gt;
      &lt;header&gt;amount4&lt;/header&gt;
      &lt;/csv&gt;
      &lt;/marshal&gt;
      &lt;to uri="file:/home/user/Terminal?fileName=abc.csv"/&gt;
      &lt;/route&gt;
  </code></pre>
  
  <p>I have also tried to use <code>&lt;convertBodyTo type="java.util.List"/&gt;</code> but it is giving me exception as </p>
  
  <blockquote>
    <p>No type converter available to convert from type:
    com.test.TestBean to the required type: java.util.List with
    value
    com.test.TestBean@26cd85e5[name=test,tumber=500,batchId=122,Type=XYZ,c_count=25,Count=14,amount=555]</p>
  </blockquote>
  
  <p>Here TestBean is my POJO and I'm returning java.util.list of TestBean objects from bean:TestProcessor. Will camel automatically link object's properties with header or do I need to write separate processor class for type conversion,if yes then how to convert java.util.list to required format in it?</p>
  
  <p>Thanks in advance.</p>