1. 程式人生 > >Caused by: java.lang.LinkageError: loader constraints violated when linking javax/el/ExpressionFacto

Caused by: java.lang.LinkageError: loader constraints violated when linking javax/el/ExpressionFacto

啟動Tomcat後,訪問JSP時(使用的是MyEclipse自帶的Tomcat,是6.0的版本),報錯: Caused by: java.lang.LinkageError: loader constraints violated when linking javax/el/ExpressionFactory class
at org.apache.jsp.WEB_002dINF.jsp.UserAction.loginUI_jsp._jspInit(loginUI_jsp.java:39)
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:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
… 40 more

說明:原因是Jbpm的juel.jar, juel-engine.jar, juel-impl.jar包和Tomcat6.0中的el-api.jar包衝突了。
有三個解決辦法:
1,方法一:在MyEclipse的Preferences -> MyEclipse -> Application Servers -> Tomcat -> … -> Paths 中配置 Append to classpath,選中 juel.jar, juel-engine.jar, juel-impl.jar 這三個jar包就可以了。
2,方法二:將 juel.jar, juel-engine.jar, juel-impl.jar 這三個包複製到tomcat6下 lib/ 中,並刪除原來的el-api.jar,
切記還要把工程中 WEB-INF\lib 下的 juel.jar, juel-engine.jar, juel-impl.jar 刪除,不然還是要衝突。
3,方法三:換成tomcat5.5,就沒有問題了。