java.lang.LinkageError: loader constraints violated when linking javax/el/Expres

悠悠隱於市發表於2011-04-11

今天使用 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從專案中移除..

 

 

相關文章