title: How to get validation events with JaXB?
body: <p>I try to get validation message in variable with Jaxb.
  Try example from here <a href="http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/1.6/api/javax/xml/bind/Unmarshaller.html" rel="noreferrer">http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/1.6/api/javax/xml/bind/Unmarshaller.html</a></p>
  
  <p>My code:</p>
  
  <pre><code>JAXBContext jaxbContext = JAXBContext.newInstance("com.piyush");
  SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
  Schema schema = factory.newSchema(new StreamSource(new File("D:/liferay-develop/workspace/cat_test/v1/STD_MP.xsd")));
  Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
  jaxbUnmarshaller.setSchema(schema);
  ValidationEventCollector validationCollector= new ValidationEventCollector();
  jaxbUnmarshaller.setEventHandler( validationCollector );
  STDMP ts = (STDMP)jaxbUnmarshaller.unmarshal(xml_gkuzu);
  if(validationCollector.hasEvents())
  {
      for(ValidationEvent event:validationCollector.getEvents())
      {
          String msg = event.getMessage();
          System.out.println(msg);
      }
  }
  </code></pre>
  
  <p>But nothing happens. What am I doing wrong ?</p>