try {
String className = "org.springframework.validation.beanvalidation.LocalValidatorFactoryBean";
clazz = ClassUtils.forName(className, WebMvcConfigurationSupport.class.getClassLoader());
}
catch (ClassNotFoundException e) {
throw new BeanInitializationException("Could not find default validator", e);
}
catch (LinkageError e) {
throw new BeanInitializationException("Could not find default validator", e);
}
validator = (Validator) BeanUtils.instantiate(clazz);
}
else {
validator = new Validator() {