在Struts 2中使用提交表单时出现NoSuchMethodError [英] NoSuchMethodError when using submitting form in Struts 2

查看:52
本文介绍了在Struts 2中使用提交表单时出现NoSuchMethodError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在通过教程进行工作.Apache Struts网站.

I'm currently working through the tutorial found on the Apache Struts website.

当前,每当我在表单上按Submit或单击Bruce Philips超链接时,我都会收到 NoSuchMethodError .

Currently, whenever I press submit on the form, or when I click the Bruce Philips hyperlink, I get a NoSuchMethodError.

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:224)
    com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:215)
    com.opensymphony.xwork2.ognl.OgnlValueStack.trySetValue(OgnlValueStack.java:187)
    com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:174)
    com.opensymphony.xwork2.ognl.OgnlValueStack.setParameter(OgnlValueStack.java:152)
        ....

我也不太清楚问题是什么,我相信我已经包括了本教程指出的所有内容.我已经尝试在我的 pom.xml 中包含依赖项,但这也没有区别.

I'm not too sure what the issue is either and I believe I've included everything the tutorial states. I've tried including the dependency in my pom.xml, but that makes no difference either.

<?xml version="1.0" encoding="UTF-8"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>Struts2PracticeSite</groupId>
  <artifactId>Struts2PracticeSite</artifactId>
    <packaging>war</packaging>
  <version>0.0.1</version>
    <build>
        <finalName>Struts2PracticeSite</finalName>
    </build>
    <dependencies>
    <dependency>
    <groupId>org.apache.struts</groupId>
    <artifactId>struts2-core</artifactId>
    <version>2.3.8</version>
</dependency>

<dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.14</version>
</dependency>
</dependencies>
    
    
</project>

关于如何解决此问题的任何想法?

Any ideas on how I would fix this problem?

推荐答案

发现问题...原来我的服务器版本太旧,无法处理struts2.我以前使用的是Geronimo 2.0.2版,现在可以正常运行了在GlassFish 3.1.2上

Problem found... Turns out my server version is too old to handle struts 2. I was previously using Geronimo version 2.0.2, and it now runs fine on GlassFish 3.1.2.

这篇关于在Struts 2中使用提交表单时出现NoSuchMethodError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆