加载器约束冲突:解析接口方法“javax.servlet.jsp.JspApplicationContext.addELResolver(Ljavax/el/ELResolver;)V”时

发布于 2024-12-25 03:24:11 字数 2813 浏览 0 评论 0原文

我在 Tomcat 7 中部署 WAR 时遇到此错误。我使用 JDeveloper 11 进行开发。

“java.lang.LinkageError:加载器约束冲突:解析接口方法“javax.servlet.jsp.JspApplicationContext.addELResolver(Ljavax/el/ELResolver;)V”时,类加载器(org/apache/catalina/的实例)当前类的 com/sun/faces/config/ConfigureListener 和类加载器(实例org/apache/catalina/loader/StandardClassLoader) 对于解析类 javax/servlet/jsp/JspApplicationContext,对于签名中使用的类型 p.JspApplicationContext.addELResolver(Ljavax/el/ELResolver;)V 有不同的 Class 对象”

我有用谷歌搜索答案并找到了答案,但似乎没有什么可以解决我的问题。我知道这与我的 /WEB-INF/lib 中的 JAR 有关,但我不知道是什么导致了错误。

这些是我在 /WEB-INF/lib 中的 JAR:

  • adf-controller-api.jar
  • adf-controller-rt-common.jar >
  • adf-controller-security.jar
  • adf-controller.jar
  • adf-dt-at-rt.jar
  • adf-richclient-api-11.jar
  • adf-richclient-impl-11.jar
  • adf-share-base.jar
  • adf -share-ca.jar
  • adf-share-security.jar
  • adf-share-support.jar
  • adf-transactions-dt.jar代码>
  • adfdt_common.jar
  • adflibfilter.jar
  • adflogginghandler.jar
  • adfm.jar
  • adfmweb.jar
  • adfsharembean.jar
  • cache.jar
  • commons-el.jar
  • db-ca.jar
  • dvt-databindings.jar
  • dvt-faces.jar
  • dvt-facesbindings.jar
  • dvt-jclient.jar
  • dvt-trinidad.jar
  • dvt-utils.jar
  • glassfish.el_2.2.0.jar
  • glassfish.jsf_1.2.9.0.jar
  • glassfish.jstl_1.2.0.1.jar
  • groovy-all-1.6.3.jar
  • identitystore.jar
  • inspect4.jar
  • javatools-nodeps.jar
  • javax.activation_1.1.0.0_1-1.jar
  • javax.ejb_3.0.1.jar
  • javax.jsf_1.0.0.0_1-2.jar
  • javax.jsp_1.1.0.0_2-1.jar
  • javax.servlet_1.0.0.0_2-5.jar
  • jdev-cm.jar
  • jewt4.jar
  • jsp-el-api.jar
  • ojdbc14.jar
  • ojmisc.jar
  • oracle- el.jar
  • oracle-page-templates.jar
  • share.jar
  • trinidad-api.jar
  • trinidad-impl.jar
  • wls.jsf.di.jar
  • xmlparserv2.jar

如何解决?

I got this error while deploying the WAR in Tomcat 7. I have carried out the development using JDeveloper 11.

"java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.addELResolver(Ljavax/el/ELResolver;)V" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, com/sun/faces/config/ConfigureListener, 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 p.JspApplicationContext.addELResolver(Ljavax/el/ELResolver;)V used in the signature"

I have googled for the answers and have found answers, but nothing seems to work for my problem. I understand that it is something to do with the JARs that I have in my /WEB-INF/lib, but I don't know which causes the error.

These are the JARs I have in /WEB-INF/lib:

  • adf-controller-api.jar
  • adf-controller-rt-common.jar
  • adf-controller-security.jar
  • adf-controller.jar
  • adf-dt-at-rt.jar
  • adf-richclient-api-11.jar
  • adf-richclient-impl-11.jar
  • adf-share-base.jar
  • adf-share-ca.jar
  • adf-share-security.jar
  • adf-share-support.jar
  • adf-transactions-dt.jar
  • adfdt_common.jar
  • adflibfilter.jar
  • adflogginghandler.jar
  • adfm.jar
  • adfmweb.jar
  • adfsharembean.jar
  • cache.jar
  • commons-el.jar
  • db-ca.jar
  • dvt-databindings.jar
  • dvt-faces.jar
  • dvt-facesbindings.jar
  • dvt-jclient.jar
  • dvt-trinidad.jar
  • dvt-utils.jar
  • glassfish.el_2.2.0.jar
  • glassfish.jsf_1.2.9.0.jar
  • glassfish.jstl_1.2.0.1.jar
  • groovy-all-1.6.3.jar
  • identitystore.jar
  • inspect4.jar
  • javatools-nodeps.jar
  • javax.activation_1.1.0.0_1-1.jar
  • javax.ejb_3.0.1.jar
  • javax.jsf_1.0.0.0_1-2.jar
  • javax.jsp_1.1.0.0_2-1.jar
  • javax.servlet_1.0.0.0_2-5.jar
  • jdev-cm.jar
  • jewt4.jar
  • jsp-el-api.jar
  • ojdbc14.jar
  • ojmisc.jar
  • oracle-el.jar
  • oracle-page-templates.jar
  • share.jar
  • trinidad-api.jar
  • trinidad-impl.jar
  • wls.jsf.di.jar
  • xmlparserv2.jar

How can I solve it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陈独秀 2025-01-01 03:24:11

您的 /WEB-INF/lib 中不应该有 servletcontainer 特定的库。至少以下内容应该是由 Tomcat 本身提供的:

  • glassfish.el_2.2.0.jar
  • javax.jsp_1.1.0.0_2-1.jar
  • javax.servlet_1.0.0.0_2-5.jar
  • jsp-el-api.jar

删除它们。该异常是由 javax.jsp_1.1.0.0_2-1.jar 引起的,该异常与 Tomcat 自己的异常不同。

另请参阅:

You should not have servletcontainer-specific libraries in your /WEB-INF/lib. At least the following ones are supposed to be already provided by Tomcat itself:

  • glassfish.el_2.2.0.jar
  • javax.jsp_1.1.0.0_2-1.jar
  • javax.servlet_1.0.0.0_2-5.jar
  • jsp-el-api.jar

Remove them. The particular exception is caused by the javax.jsp_1.1.0.0_2-1.jar one, which is different from Tomcat's own one.

See also:

云胡 2025-01-01 03:24:11

将项目从 WAS6 迁移到 WAS 7 时,我遇到了同样的错误。修复方法如下:

  1. 更新 web.xml:
    一个。打开项目名称\src\main\webapp\WEB-INF\web.xml
    b.添加以下监听器:

    com.sun.faces.config.ConfigureListener

    更新web.xml

c.构建项目并将其部署到 Websphere

  1. 更改加载程序顺序:
    一个。打开Websphere应用程序服务器控制台
    b.转到:应用>>应用程序类型>> WebSphere 企业应用程序
    c.点击项目
    d.点击“类加载和更新检测”
    e.选择“首先使用父加载器加载的类”
    f.单击“应用”

  2. 禁用 JSP 类重新加载
    一个。转到:应用>>应用程序类型>> WebSphere 企业应用程序
    b.点击项目
    c.单击 JSP 和 JSF 选项
    d.取消选中“JSP 启用类重新加载”
    e.单击“确定”

  3. 更改 JSF 实现
    一个。转到:应用>>应用程序类型>> WebSphere 企业应用程序
    b.点击项目
    c.单击 JSP 和 JSF 选项
    d.在 JSF 实现下选择“MyFaces 1.2”

  4. 启动项目

I had the same error when migrating a project from WAS6 to WAS 7. Here is the fix:

  1. Update web.xml:
    a. Open Project_name\src\main\webapp\WEB-INF\web.xml
    b. Add the following listener:

    Com.sun.faces.config.ConfigureListener

c. Build the project and deploy it to Websphere

  1. Change loader order:
    a. Open Websphere application server Console
    b. Go to: Applications >> Application Types >> WebSphere enterprise applications
    c. Click at the project
    d. Click “Class loading and update detection”
    e. Choose “Classes loaded with parent loader first”
    f. Click Apply

  2. Disable JSP class reloading
    a. Go to: Applications >> Application Types >> WebSphere enterprise applications
    b. Click at the project
    c. Click at JSP and JSF options
    d. Uncheck “JSP enable class reloading”
    e. Click OK

  3. Change JSF Implementation
    a. Go to: Applications >> Application Types >> WebSphere enterprise applications
    b. Click at the project
    c. Click at JSP and JSF options
    d. Choose “MyFaces 1.2” under JSF Implementation

  4. Start the Project

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文