【发布时间】:2011-04-15 05:52:58
【问题描述】:
我在一个项目中遇到了两次相同的 .jar(对我来说是 el-api.jar v2.1)的问题,因此,当我尝试使用 Tomcat 6 运行我的项目时出现以下错误堆栈。
WARNING: Unexpected error forwarding to login page
javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/login_jsp, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type javax/el/ExpressionFactory used in the signature
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/login_jsp, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type javax/el/ExpressionFactory used in the signature
我找到了 http://blog.springsource.com/2008/10/20/understanding-the-osgi-uses-directive/
但这没有用,因为解决方案影响了我项目的太多部分。
我无法对 Tomcat 进行任何更改,并且该项目将被许多其他用户使用。
当前的解决方法是每次我们进行构建并使用 Tomcat6 时手动删除 el-api.jar。然后我们需要把 .jar 放回去,因为这是其他东西的要求。
我使用 Maven 2 和 Maven 3 构建。 (顺便说一句,有人知道在 Jruby 上使用 Maven3 吗?)
谁能帮我解决这个问题?
【问题讨论】:
-
抱歉含糊不清,为了解决这个问题,我认为它需要一种方法来确保 Tomcat 6 只拾取一个 el-api.jar 而不是两个。约束将是: - Tomcat 6 没有变化 - 一个版本 - 解决方案可以持续集成到构建中
标签: java maven-2 continuous-integration