How to map DB Map to XLS file in mule datamapper?
<p>I was trying to query a DB using an excel sheet values as a select parameter. I was getting the result set perfectly but I can't map it to an XLS using data mapper. </p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;

&lt;mule xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:batch="http://www.mulesoft.org/schema/mule/batch" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd
http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/batch http://www.mulesoft.org/schema/mule/batch/current/mule-batch.xsd
http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd"&gt;
    &lt;data-mapper:config name="MS_Excel_To_Map" transformationGraphPath="ms_excel_to_map.grf" doc:name="MS_Excel_To_Map"/&gt;
    &lt;db:generic-config name="Generic_Database_Configuration" url="jdbc:as400://awh400.awh.com.au/wsprdp;user=AWSTEST;password=TESTUSER" driverClassName="com.ibm.as400.access.AS400JDBCDriver" doc:name="Generic Database Configuration"/&gt;
    &lt;data-mapper:config name="List_Map__To_MS_Excel" transformationGraphPath="list_map__to_ms_excel.grf" doc:name="List_Map__To_MS_Excel"/&gt;
    &lt;batch:job name="wettenhalls_finalBatch"&gt;
        &lt;batch:input&gt;
            &lt;file:inbound-endpoint path="C:\Users\pd00h\Desktop\Wettenhalls\Inbound" responseTimeout="10000" doc:name="File"/&gt;
            &lt;file:file-to-byte-array-transformer doc:name="File to Byte Array"/&gt;
            &lt;data-mapper:transform config-ref="MS_Excel_To_Map" doc:name="MS Excel To Map"/&gt;
        &lt;/batch:input&gt;
        &lt;batch:process-records&gt;
            &lt;batch:step name="Batch_Step"&gt;
                &lt;db:select config-ref="Generic_Database_Configuration" doc:name="Database"&gt;
                    &lt;db:parameterized-query&gt;&lt;![CDATA[SELECT DELODNBR, DELODNBLS FROM wsprdd.wsdlvlod WHERE DELODNBR = #[payload.'cus_ref']]]&gt;&lt;/db:parameterized-query&gt;
                &lt;/db:select&gt;
                &lt;data-mapper:transform config-ref="List_Map__To_MS_Excel" doc:name="List&amp;lt;Map&amp;gt; To MS Excel"/&gt;
                &lt;logger level="INFO" doc:name="Logger"/&gt;
                &lt;file:outbound-endpoint path="C:\Users\pd00h\Desktop\Wettenhalls\Outbound" outputPattern="#[message.id].xls" responseTimeout="10000" doc:name="File"/&gt;
            &lt;/batch:step&gt;
        &lt;/batch:process-records&gt;
        &lt;batch:on-complete&gt;
            &lt;logger level="INFO" doc:name="Logger"/&gt;
        &lt;/batch:on-complete&gt;
    &lt;/batch:job&gt;
&lt;/mule&gt;
</code></pre>

<p>I keep on getting Null Pointer errors</p>

<p>org.mule.api.MessagingException: null (java.lang.NullPointerException). Message payload is of type: LinkedList</p>

<p>null (java.lang.NullPointerException)</p>

<p>Im not sure if I missed a step. I need to populate the matching values from the input xls to the output xls.</p>

<p>thanks</p>