jetty、tomcat启动发生异常 java.lang.NoClassDefFoundError: org.apache.jasper.el.ELContextImpl

1 篇文章 0 订阅
1 篇文章 0 订阅

公司原来web项目是在tomcat 下运行 包括tomcat运行环境在内所有的jar都放到目录WEB-INF/lib下,一切正常,切换到jetty(9.3)以后启动报错

java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.el.ELContextImpl

查了一下 原来是因为 serlet容器jar冲突导致


以下摘自http://stackoverflow.com 一篇 提问,说得很好,

That can happen if your webapp ships with servletcontainer-specific JAR files such as jasper.jarjetty.jar servlet.jar, etc in the /WEB-INF/lib for some unclear reason. This is in turn conflicting with with a different versioned JAR file on the target servletcontainer.

Remove that servletcontainer-specific JAR file from your webapp's /WEB-INF/lib. It doesn't belong there. It's supposed to be already supplied by the servletcontainer itself.

原文


解决办法,删除项目目录下 有关 jasper servlet的jar  依赖容器本身的jar运行,避免冲突。原文解释中有一句话 “ It doesn't belong there.”,我觉得 这句话很关键,提醒我们该谁管的就该谁去管,别瞎往一起整,呵呵。

感叹一下做这个web项目框架整合的哥们。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值