今天使用 Maven 搭建一个项目,在pom.xml配置文件里面,加了几个jar包,.
居然报如下错误,
严重: Servlet.service() for servlet jsp threw exception
java.lang.LinkageError: loader constraints violated when linking javax/el/ExpressionFactory class
at org.apache.jsp.index_jsp._jspInit(index_jsp.java:22)
at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
然后在maven的pom.xml文件里面找到.
<dependency> <groupId>javax.el</groupId> <artifactId>el-api</artifactId> <version>1.0</version> </dependency>
解决方案:
原因是tomcat的按照目录下,已经存在el-api这个jar包,导致发生冲突, 删除掉即可.
或者你如果是lib目录中加的就直接在lib目录中,选择此el-api.jar从项目中移除..