title: Using Jaxb2Marshaller to unmarshall an xml and validate against a schema
body: <p>I am implementing a REST service with xml as the payload and have the following configuration to use Jaxb2Marshaller to unmarshall my xml. Here is the configuration from my spring context file </p>
  
  <pre><code>&lt;bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"&gt;
          &lt;property name="classesToBeBound"&gt;
              &lt;list&gt;
                  &lt;value&gt;com.my.examples.Product&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="schema" value="classpath:schemadefinitions/product.xsd" /&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>On my bean <strong>Product</strong> I have just this annotation as </p>
  
  <p>@XmlRootElement(name="product")
  public class ProductInfo {</p>
  
  <p>The issue is when I make the REST request it unmarshalls xml to bean properly but doesn't perform any validation against the schema configured with the marshaller. Am I missing anything ? </p>