1. 程式人生 > >Java.lang.LinkageError

Java.lang.LinkageError

【轉】http://blog.csdn.net/zhangspring1234/article/details/8841295

1.linkage Error

 Java.lang.LinkageError: loader constraint violation: when resolving interface method異常

嚴重: Servlet.service() for servlet jsp threw exception

解決辦法:

 就是你不能在專案的lib目錄中再包含 伺服器類提供過jar  比如jsp-api.jarel-api.jarservlet-api.jar

, 等等

2.【轉】http://chxkyy.iteye.com/blog/153689

javax.faces.FacesException: java.lang.LinkageError: loader constraints violated when linking javax/el/ExpressionFactory class  
    org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:425)  
    org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)  
    org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)  
    org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)  
    org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)  
    org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)  
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)  
    org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)  
    org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)  

錯誤的原因是tomcat/lib下的el-api.jar與專案WEB-INF/lib目錄下的el-api.jar衝突。

把專案目錄下的el-api.jar刪除即可。