u010354907
昵称暂无
2012-06-14 10:27
浏览 193
已采纳

Struts2 配置文件中传参报错,大家帮忙看看,急

这是STRUTS的配置:

getLines?cityArea=${cityArea}

ACTION中参数cityArea也有get、set:
public String getCityArea() {
return cityArea;
}

public void setCityArea(String cityArea) {
    this.cityArea = cityArea;
}

这是外部包的引用:

[img]http://dl.iteye.com/upload/attachment/0069/5269/8121d077-8f96-3d74-b7d8-13c0754a11f4.jpg[/img]

[img]http://dl.iteye.com/upload/attachment/0069/5271/cc9a57ee-9c80-338c-9d1f-7d6a6b3a1b25.jpg[/img]

报错信息如下:

message

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.NoClassDefFoundError
com.opensymphony.xwork.util.OgnlValueStack$ObjectAccessor.getProperty(OgnlValueStack.java:55)
ognl.OgnlRuntime.getProperty(OgnlRuntime.java:2210)
com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor.getProperty(CompoundRootAccessor.java:125)
ognl.OgnlRuntime.getProperty(OgnlRuntime.java:2210)
ognl.ASTProperty.getValueBody(ASTProperty.java:114)
ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
ognl.SimpleNode.getValue(SimpleNode.java:258)
ognl.Ognl.getValue(Ognl.java:494)
com.opensymphony.xwork2.ognl.OgnlUtil.getValue(OgnlUtil.java:206)
com.opensymphony.xwork2.ognl.OgnlValueStack.findValue(OgnlValueStack.java:276)
com.opensymphony.xwork2.ognl.OgnlValueStack.findValue(OgnlValueStack.java:303)
com.opensymphony.xwork2.util.TextParseUtil.translateVariables(TextParseUtil.java:185)
com.opensymphony.xwork2.util.TextParseUtil.translateVariables(TextParseUtil.java:118)
com.opensymphony.xwork2.util.TextParseUtil.translateVariables(TextParseUtil.java:62)
org.apache.struts2.dispatcher.StrutsResultSupport.conditionalParse(StrutsResultSupport.java:198)
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:185)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:362)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:266)
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)

大家帮忙看下是哪的问题,多谢了。

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

9条回答 默认 最新

  • aa1aa3
    爱上一条鱼 2012-06-14 10:48
    已采纳

    [quote]root cause
    java.lang.NoClassDefFoundError [/quote]

    汗。。。你哪个class没找到没贴出来吧。。。。一般NoClassDefFoundError 后面会提示哪个类的吧

    个人觉得要不就是缺包 要不就是包多了

    点赞 评论
  • aa1aa3
    爱上一条鱼 2012-06-14 11:15

    囧 那你把改成forward试试 不要用redirect

    点赞 评论
  • zyengogo
    永恩 2012-06-14 11:35

    你的包有点多。

    点赞 评论
  • iteye_15298
    iteye_15298 2012-06-14 13:05

    是不是设置了devMode =true了. 改成false 试试看.

    点赞 评论
  • iteye_18131
    iteye_18131 2012-06-14 14:49

    有说是classpath里没有设置 “.” 导致的…试一下

    点赞 评论
  • jyjava123
    jyjava123 2012-06-14 15:15

    如果是前台传入后台的时候发的错误,那么就看看你的属性设置,你可以把这个city属性删了,再看看是否还报错,

    点赞 评论
  • jadethao
    jadethao 2012-06-14 16:40

    看错误提示估计是jar包的问题,找找看是否有这个包,或者有包冲突,删掉多余的就可以了!

    点赞 评论
  • weipeng19861130
    weipeng19861130 2012-06-15 12:22

    报过滤器执行出错和java.lang.NoClassDefFoundError错误,NoClassDefFoundError表示在类加载时候未找到定义--该类不存在。综合下,可能是你过滤器配置路径或者未导入对应过滤器的包。看看你的配置文件中过滤器的配置

    点赞 评论
  • weipeng19861130
    weipeng19861130 2012-06-15 12:23

    你把你的struts2中对应过滤器的配置信息帖出来吧

    点赞 评论

相关推荐