目前我正在使用Live struts2项目。该项目工作正常。但有时,我会得到一些意想不到的行为。
作为一个例子,我正在测试项目,一切正常。突然,我重复了相同的操作并得到了以下错误。
Struts Problem Report Struts has detected an unhandled exception: Messages: There is no Action mapped for namespace / and action name rfq. Stacktraces There is no Action mapped for namespace / and action name rfq. - [unknown location] com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189) org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) java.lang.Thread.run(Unknown Source) You are seeing this page because development mode is enabled. Development mode, or devMode, enables extra debugging behaviors and reports to assist developers. To disable this mode, set: struts.devMode=false in your WEB-INF/classes/struts.properties file.
我使用相同的操作再次测试,并且工作正常。
我对问题进行了研究,但解决方案是频繁出错,但这个错误很少和出乎意料地出现。
有没有人遇到过这种问题并解决了?
N.B:很抱歉,由于时间不够,我无法分享项目结构。任何帮助都会得到满足。
以下行动负责
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="true"/>
<constant name="struts.devMode" value="true"/>
<constant name="struts.custom.i18n.resources" value="ApplicationResources"/>
<!--<constant name="struts.action.excludePattern" value="/CommonsFileUploadServlet" />-->
<!--<constant name="struts.multipart.handler" value="jakarta" />-->
<constant name="struts.multipart.maxSize" value="100000000"/>
<!--<constant name="struts.multipart.saveDir" value="D:/tmp" />-->
<!--<package name="com/deloitte/in/action" extends="struts-default"> -->
<!--<package name="mbe/iproc/action" extends="json-default">-->
<package name="default" namespace="/" extends="struts-default,json-default">
<interceptors>
<interceptor name="SessionCheckInterceptor"
class="mbe.iproc.interceptor.SessionCheckInterceptor"/>
<interceptor-stack name="testSessionValidationStack">
<interceptor-ref name="SessionCheckInterceptor" />
<interceptor-ref name="defaultStack" />
</interceptor-stack>
<interceptor name="MyFile"
class="mbe.iproc.interceptor.MyFileInterceptor">
</interceptor>
<interceptor-stack name="fileUploadStack">
<interceptor-ref name="MyFile" />
<interceptor-ref name="basicStack" />
<interceptor-ref name="i18n" />
</interceptor-stack>
</interceptors>
<!--<default-interceptor-ref name="loggedInDefaultStack" />-->
<global-results>
<result name="error">/error.jsp</result>
<result name="sessionexpired">/sessionExpiredIntermediate.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping
exception="org.apache.struts.register.exceptions.SecurityBreachException"
result="securityerror"/>
<exception-mapping exception="java.lang.Exception"
result="error"/>
</global-exception-mappings>
<action name="LOGIN" class="loginAction">
<result name="success" type="redirect">POOUST</result>
<result name="failure">/login.jsp</result>
<result name="firstentry">/change_password.jsp</result>
</action>
<action name="POOUST" method="poOustList" class="poOustAction">
<interceptor-ref name="testSessionValidationStack"/>
<result name="success">/home.jsp</result>
<result name="superLoginSuccess">/homeAdmin.jsp</result>
<result name="scmLoginSuccess">/homeScm.jsp</result>
<result name="qaSuperLoginSuccess">/homeQA.jsp</result>
<result name="inspLoginSuccess">/homeQA.jsp</result>
<result name="failure">/home.jsp</result>
</action>