title: Camel-Castor getting error while unmarshalling and while marshalling also its not using mapping file
body: <p>I have a problem with unmarshaling and then marshaling.</p>
  
  <p><strong>My input:</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  &lt;GetDeadlineOffset&gt;
      &lt;deadlineCode&gt;DC1&lt;/deadlineCode&gt;
      &lt;parameters&gt;
        &lt;parameter name="P1"&gt;Param 1&lt;/parameter&gt;
        &lt;parameter name="P2"&gt;Param 2&lt;/parameter&gt;
      &lt;/parameters&gt;
  &lt;/GetDeadlineOffset&gt;
  </code></pre>
  
  <p><strong>My mapping:</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;class name="com.evolvus.training.camel.domain.GetDeadlineOffset"&gt;
      &lt;map-to xml="GetDeadlineOffset"/&gt;
      &lt;field name="DeadlineCode"&gt;
          &lt;bind-xml name="deadlineCode" /&gt;
      &lt;/field&gt;
      &lt;field name="parameters" type="com.evolvus.training.camel.domain.Parameter" collection="collection"&gt;
          &lt;bind-xml name="parameter" location="parameters"&gt;
              &lt;class name="com.evolvus.training.camel.domain.Parameter"&gt;
                  &lt;field name="Name"&gt;
                      &lt;bind-xml name="name" node="attribute" /&gt;
                  &lt;/field&gt;
                  &lt;field name="Value"&gt;
                      &lt;bind-xml node="text"/&gt;
                  &lt;/field&gt;
              &lt;/class&gt;
          &lt;/bind-xml&gt;
      &lt;/field&gt;        
  &lt;/class&gt;
  </code></pre>
  
  <p><strong>My classes:
  Parameter.java</strong></p>
  
  <pre class="lang-java prettyprint-override"><code>public class Parameter {
     private String name = null;
     private String value = null;
    //setters and getters
  }
  </code></pre>
  
  <p><strong>GetDeadlineOffset.java</strong></p>
  
  <pre class="lang-java prettyprint-override"><code>public class GetDeadlineOffset {
     private String deadlineCode = null;
     private Vector&lt;Parameter&gt; paramList = new Vector&lt;Parameter&gt;();
     //setters and getters
  }
  </code></pre>
  
  <p><strong>ISO3166Processor.java</strong></p>
  
  <pre class="lang-java prettyprint-override"><code>public class ISO3166Processor implements Processor {
     public void process(Exchange arg0) throws Exception {
        GetDeadlineOffset iso4217 = (GetDeadlineOffset) arg0.getIn().getBody();
        System.out.println("Unmarshalled Object is: " + iso4217);
        arg0.setOut(arg0.getIn());
        arg0.getOut().setBody(gdo);
        arg0.getOut().setHeaders(arg0.getIn().getHeaders());
     }
  }
  </code></pre>
  
  <p>route:</p>
  
  
  
  <pre><code>&lt;bean id="currencyProcessor" class="com.evolvus.training.camel.processor.ISO3166Processor" /&gt;
  &lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;
  
     &lt;dataFormats&gt;
        &lt;castor id="iso3166" 
           mappingFile="castor/castor-mapping.xml"
           packages="com.evolvus.training.camel.domain"/&gt;
     &lt;/dataFormats&gt;
  
     &lt;route&gt;
        &lt;from uri="file:src/data/in?noop=true"/&gt;
        &lt;unmarshal ref="iso3166"/&gt;   
        &lt;log message="unmarshall" /&gt;
        &lt;process ref="currencyProcessor" /&gt; 
        &lt;log message="processed" /&gt;
        &lt;marshal ref="iso3166" /&gt;
        &lt;log message="reachng output2" /&gt;
        &lt;to uri="file:src/data/out?fileName=${id}" /&gt;
        &lt;stop&gt;&lt;/stop&gt;
     &lt;/route&gt;
  &lt;/camelContext&gt;
  </code></pre>
  
  <p><strong>Exception:</strong></p>
  
  <pre><code>Exhausted after delivery attempt: 1 caught:
  java.lang.NullPointerException java.lang.NullPointerException
  at org.exolab.castor.mapping.Mapping.loadMapping(Mapping.java:276)
  [org.apache.servi‌​cemix.bundles.castor-1.3.1_2.jar:] –
  
  The class for the root element 'GetDeadlineOffset' could not be found.
  File: [not available]; line: 2; column: 20}
  at org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException(Unmarsh‌​aller.java:794)
  [org.apache.servicemix.bundles.castor-1.3.1_2.jar:] 
  </code></pre>
  
  <p>If I marshal it says consider switching to using Marshaller instances and calling one of the <code>marshal()</code> methods*. Please give me resolution for this also. How to call non-static method of marshall using camel?</p>