SpringBoot 发布到Tomcat运行报错defaultValidator

在Tomcat7中会报异常:

Error creating bean with name 'defaultValidator' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.validation.beanvalidation.LocalValidatorFactoryBean]: Factory method 'defaultValidator' threw exception; nested exception is java.lang.NoClassDefFoundError: javax/el/ELManager

原因: tomcat7中的el-api,版本太低,换成tomcat8即可

你可能感兴趣的:(SpringBoot 发布到Tomcat运行报错defaultValidator)