Search in sources :

Example 1 with ValidationConfigType

use of org.apache.openejb.jee.bval.ValidationConfigType in project tomee by apache.

the class ReadDescriptors method readValidationConfigType.

private void readValidationConfigType(final Module module) throws OpenEJBException {
    if (module.getValidationConfig() != null) {
        return;
    }
    final Source value = getSource(module.getAltDDs().get("validation.xml"));
    if (value != null) {
        try {
            final ValidationConfigType validationConfigType = JaxbOpenejb.unmarshal(ValidationConfigType.class, value.get(), false);
            module.setValidationConfig(validationConfigType);
        } catch (final Exception e) {
            logger.warning("can't read validation.xml to construct a validation factory, it will be ignored");
        }
    }
}
Also used : ValidationConfigType(org.apache.openejb.jee.bval.ValidationConfigType) InputSource(org.xml.sax.InputSource) OpenEJBException(org.apache.openejb.OpenEJBException) JAXBException(javax.xml.bind.JAXBException) SAXException(org.xml.sax.SAXException) IOException(java.io.IOException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException)

Aggregations

IOException (java.io.IOException)1 JAXBException (javax.xml.bind.JAXBException)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 OpenEJBException (org.apache.openejb.OpenEJBException)1 ValidationConfigType (org.apache.openejb.jee.bval.ValidationConfigType)1 InputSource (org.xml.sax.InputSource)1 SAXException (org.xml.sax.SAXException)1