• HTTP Status 500


    使用struts2过程中碰到以下错误

    HTTP Status 500 - com.opensymphony.xwork2.ActionSupport.toAddPage()
    type Exception report
    
    message com.opensymphony.xwork2.ActionSupport.toAddPage()
    
    description The server encountered an internal error that prevented it from fulfilling this request.
    
    exception
    
    java.lang.NoSuchMethodException: com.opensymphony.xwork2.ActionSupport.toAddPage()
        ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1246)
        ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68)
        com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:117)
        com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:108)
        ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1369)
        ognl.ASTMethod.getValueBody(ASTMethod.java:90)
        ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
        ognl.SimpleNode.getValue(SimpleNode.java:258)
        ognl.Ognl.getValue(Ognl.java:494)
        ognl.Ognl.getValue(Ognl.java:458)
        com.opensymphony.xwork2.ognl.OgnlUtil$2.execute(OgnlUtil.java:309)
        com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecute(OgnlUtil.java:340)
        com.opensymphony.xwork2.ognl.OgnlUtil.getValue(OgnlUtil.java:307)
        com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:423)
        com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:287)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:250)
        org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
        org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:76)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:125)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:253)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:139)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
        org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
        org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564)
        org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81)
        org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
    note The full stack trace of the root cause is available in the Apache Tomcat/8.5.9 logs.

    原因是忘记在<action/>中写class属性值了。

  • 相关阅读:
    赶紧收藏吧!MyBatis-Plus万字长文图解笔记,错过了这个村可就没这个店了
    这篇建议java开发都看看,对Java方法及加深理解的很深,值得一看!
    秒极啊!手把手带你进行shiro授权拦截器的重写,学到了学到了
    java面试复习重点:类的管理及常用工具,教你抓住面试的重点!
    手撸一个外卖点餐系统后台,可以写上简历的实战项目!
    JVM类加载机制详解,建议看这一篇就够了,深入浅出总结的十分详细!
    这份SpringMVC执行原理笔记,建议做java开发的好好看看,总结的很详细!
    iOS-----GitHub上比较齐全的iOS 工具和App
    iOS-----AVFoundation框架的功能详解
    iOS-----UIScrollView
  • 原文地址:https://www.cnblogs.com/liaoxiaolao/p/9945834.html
Copyright © 2020-2023  润新知