关于Infinite recursion detected

简介:

   在我之前的一篇博文中《基于struts2 拦截器ResultType为chain的Action之间数据传递 ——表单页面打开优化》提到使用chain类型的action之间传递数据用以优化表单页面iframe的加载速度。今天,其实应该之前,曾经也出现过如下的报错信息(生产系统),当时的问题是flowFormNextViewIndex的result对应的jsp存在错误,但该错误未直接报出,反倒给出一堆莫针的提示,比如这篇文章提到关于struts2表单提交Infinite recursion detected问题原因的疑问,因页面与实体bean定义存在不一致,因使用chain类型莫名报出该错误的困惑。刚在调试其他问题的时候,我本地也一闪而过该报错。当我重启tomcat时,该报错消失。

    对于网上可供查询的资料,多数方案是去掉chain类型,或者去掉自定义的拦截器:

比如:

1.Infinite recursion detected:去掉chain类型;

2.INfinite recursion detected .去掉自定义拦截器;

3.关于错误:Infinite recursion detected:去掉chain;

4.困惑:nfinite recursion detected:去掉chain

报错信息:

HTTP Status 500 - Infinite recursion detected: [/workflow/doJob!doJob, /workflow/flowFormNextViewIndex, /workflow/flowFormNextViewIndex]


type Exception report

message Infinite recursion detected: [/workflow/doJob!doJob, /workflow/flowFormNextViewIndex, /workflow/flowFormNextViewIndex]

description The server encountered an internal error that prevented it from fulfilling this request.

exception

Infinite recursion detected: [/workflow/doJob!doJob, /workflow/flowFormNextViewIndex, /workflow/flowFormNextViewIndex] - [unknown location] com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java:214) com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275) com.gc.platform.web.struts.interceptor.ExceptionInterceptor.exception(ExceptionInterceptor.java:83) com.gc.platform.web.struts.interceptor.ExceptionInterceptor.intercept(ExceptionInterceptor.java:59) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:563) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) com.gc.platform.web.context.filter.ContextFilter2.doFilter(ContextFilter2.java:115) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.jasig.cas.client.util.AssertionThreadLocalFilter.doFilter(AssertionThreadLocalFilter.java:54) org.jasig.cas.client.util.HttpServletRequestWrapperFilter.doFilter(HttpServletRequestWrapperFilter.java:75) org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:201) org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:107) org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:76)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.39 logs.

   最后经我确认,发现该错误的原因由另外一个已发现的bug引起:

  1. OA系统 OA-4755

【工作流】IE环境下,用户点击我的工作中流程名称进入待办任务时,页面报错,如截图所示

wKiom1bwtiCwr-70AACwEHIMwQE825.png

   该错误已经定位,在taskRun.jsp页面中,有两个工作入口,一个是点击办理任务链接,一个点击流程名。在ie和fixfox中点击流程名是报错的,报错如上。

其代码如下:

1
  return  '<a class="link_text" href="javacript:;" onclick="process(\'' +value.id+ '\')">' +value.name+ '</a>' + temp;

修改后的如下:

1
  return  '<a class="link_text" href="#" onclick="process(\'' +value.id+ '\')">' +value.name+ '</a>' + temp;

  两者区别只是一个href为javascript,一个是#。<a>标签的作用

1一般作用的跳转页面 需要设置跳转的页面就是 在href属性中设置要跳转的地址
2.作为一个按钮使用,可以点击 但是不跳转页面而是做其他处理,就需要设置href 属性为javascript:

而#的作用和javascript:void(0);相同,即原页面跳回顶部。

        但在实际应用中,空的javasript在ie和fixfox中还报出了错误。其中fixfox报出的错误即本文Infinite recursion detected,可见各种错误都可能引起该错误的报出,而真实的错误往往被隐藏了。

在这篇文章Struts Problem Report中作者提到:

Struts has detected an unhandled exception:

Messages:
  • Infinite recursion detected: [/exception/!execute, /exception/default, /exception/default]

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.

         关于 devMode,请参考

struts的DevMode模式

 

      综合我们出现的两次Infinite recursion detected问题,该问题的产生往往是其他地方发生问题,可能是偶发的,比如我本地重启之后不再报错,或者是来自其他方面的错误,比如本次的空javasript,其真实的错误被隐藏了(某表缺少字段)。








     本文转自 gaochaojs 51CTO博客,原文链接:http://blog.51cto.com/jncumter/1753780,如需转载请自行联系原作者


相关文章
|
7月前
|
Python
Indirect recursion
Indirect recursion 是指在函数调用中,函数体内部调用另一个函数,而这个被调用的函数又调用了该函数本身,形成了递归调用。这种递归调用是通过间接的方式实现的,因此被称为间接递归。 使用间接递归可以使代码更加简洁和易于理解。例如,考虑一个计算阶乘的函数,使用直接递归的实现方式会比较复杂,而使用间接递归则可以很简单地实现。
33 5
|
12月前
|
机器学习/深度学习 PyTorch 算法框架/工具
【完美解决】RuntimeError: one of the variables needed for gradient computation has been modified by an inp
将loss.backward()函数内的参数retain_graph值设置为True, loss.backward(retain_graph=True),如果retain_graph设置为False,计算过程中的中间变量使用完即被释放掉。
752 0
|
程序员
Uncaught ReferenceError: Invalid left-hand side in assignment
Uncaught ReferenceError: Invalid left-hand side in assignment
297 0
|
Shell
Solving environment: failed with initial frozen solve. Retrying with flexible solve的解决方法
Solving environment: failed with initial frozen solve. Retrying with flexible solve的解决方法
11207 0
Solving environment: failed with initial frozen solve. Retrying with flexible solve的解决方法
1142. Maximal Clique (25) 19‘
#include #include #include #include #include using namespace std; int e[201][201]; vector temp; bool judge(){ int flag = 1; for(int i = 0; i < temp.
959 0
|
人工智能
The left-hand side of an assignment must be a variable
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545} p.p2 {margin: 0.
1174 0

热门文章

最新文章