hibernate-validator版本问题引发的tomcat7下项目启动失败

栏目: Java · 发布时间: 5年前

内容简介:jdk8tomcat7.0.90版本引入包:hibernate-validator:6.0.16.Final版本,使用邮箱验证注解功能,则需要依赖加载对应javax/el/ELManager。

线上环境

jdk8

tomcat7.0.90

报错

java.lang.NoClassDefFoundError:javax/el/ELManager

原因

版本引入包:hibernate-validator:6.0.16.Final版本,使用邮箱验证注解功能,则需要依赖加载对应javax/el/ELManager。

因线上使用tomcat版本为tomcat7.0.90,在其CATALINA_HOME/lib目录下的el-api.jar的版本为2.2版本,无类javax/el/ELManager。

(tomcat8中,el-api.jar包升级为3.0版本,不会找不到类)因此启动失败。

解决

将hibernate-validator版本降到5.4.3.Final版本,去除引用校验邮箱的注解特性,该用业务代码处理

为什么线下未发现呢?因为线下环境使用的tomcat版本为8.5.32版本,与线上未统一。当然这也是不合理的点


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Intersectional Internet

The Intersectional Internet

Safiya Umoja Noble、Brendesha M. Tynes / Peter Lang Publishing / 2016

From race, sex, class, and culture, the multidisciplinary field of Internet studies needs theoretical and methodological approaches that allow us to question the organization of social relations that ......一起来看看 《The Intersectional Internet》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具