【发布时间】:2015-09-23 10:22:50
【问题描述】:
我有一个 Struts2 应用程序,它在 Eclipse 上运行良好,我还在普通的 Tomcat6 Web 服务器上进行了尝试(将 .war 文件复制到 webapps 文件夹)。
但是在 WebSphere Application Server 上部署 .war 文件后,在应用程序中提交表单时收到以下错误:
知道怎么解决吗?
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Filter execution threw an exception
root cause
java.lang.NoSuchMethodError: ognl/SimpleNode.isEvalChain(Lognl/OgnlContext;)Z
com.opensymphony.xwork2.ognl.OgnlUtil.isEvalExpression(OgnlUtil.java:223)
com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:214)
【问题讨论】:
-
类路径中有一些旧的OGNL依赖,删除它。
-
生成war文件时,war文件包含一个ognl-3.0.5.jar文件。我试图将它排除在依赖之外,但我收到了同样的问题。 struts2-core 包含 OGNL 依赖项。在 Tomcat6 和 Tomcat7 服务器上,它运行良好,符合预期。
-
不要排除
ognl-3.0.5。在使用应用程序库的 websphere 中配置您的应用程序。 -
我们计划使用 Apache Geronimo(在 Websphere Application Server 上)。
-
尝试通过 WebSphere 管理控制台在 Web 模块配置选项中将类加载器配置为 Parent_Last。
标签: java eclipse tomcat struts2 websphere