SpringBoot 发布到Tomcat运行报错原因之一

IntelliJ IDEA搭建SpringBoot应用: https://www.cnblogs.com/winner-0715/p/6666302.html

SpringBoot发布到独立的tomcat中运行: https://blog.csdn.net/qq_28988969/article/details/78135768

1、当版本号为:
1.5.6.RELEASE
SpringBoot 发布到Tomcat运行报错原因之一_第1张图片

可以以在Tomcat7中运行


2、当版本号为:

2.0.3.RELEASE
SpringBoot 发布到Tomcat运行报错原因之一_第2张图片

在Tomcat8中运行正常

在Tomcat7中会报异常:

org.springframework.beans.factory.BeanCreationException: 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,版本太低


你可能感兴趣的:(javaEE)