Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: for the plan.

Jump to: navigation, search


Turn BV in JAXB off

By default, BV is in mode AUTO. That means, if BV provider is found on classpath, it is turned on, otherwise it is silently turned off and an informative message is logged.

In order to switch BV off, a property must be passed to either JAXBContext, Marshaller or Unmarshaller.


 Map<String, BeanValidationMode> props = new HashMap<>();
 props.put(JAXBContextProperties.BEAN_VALIDATION_MODE, BeanValidationMode.NONE);
 Class[] classes = new Class[] { Customer.class };
 JAXBContext jaxbContext = JAXBContext.newInstance(classes, props);

Back to the top