在我之前的一篇博文中《基于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 yourWEB-INF/classes/struts.propertiesfile.

关于devMode,请参考

struts的DevMode模式

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

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

关于Infinite recursion detected相关推荐

  1. Could not write JSON: Infinite recursion (StackOverflowError);

    转自:https://blog.csdn.net/east123321/article/details/80435051 在controller返回数据到统一json转换的时候,出现了json inf ...

  2. JPA HttpMessageNotWritableException: Could not write content: Infinite recursion (StackOverflowError

     一.异常信息 正常查询数据没有问题,但是在以json形式返回到前端会出现此异常 WARN 22788 --- [nio-8081-exec-2] .w.s.m.s.DefaultHandlerExc ...

  3. 返回JSON出现Infinite recursion无限循环错误的解决

    在数据库返回树形结构数据之后,想转换成JSON返回页面时出错: org.springframework.http.converter.HttpMessageNotWritableException: ...

  4. SpringBoot之解决一对一、多对一、多对多等关联实体在JSON序列化/输出时产生的无限递归死循环问题(infinite recursion)

    SpringBoot之解决一对一.多对一.多对多等关联实体在JSON序列化/输出时产生的无限递归死循环问题(infinite recursion) 参考文章: (1)SpringBoot之解决一对一. ...

  5. Could not write JSON: Infinite recursion (StackOverflowError) (through reference chain:

    环境:springmvc+hibernate 返回json格式的数据 在controller返回数据到统一json转换的时候,出现了json infinite recursion stackoverf ...

  6. 栈溢出:Infinite recursion (StackOverflowError)

    今天程序中突然出现一个bug,报告的是栈溢出的错Infinite recursion (StackOverflowError),问题如下截图: 经排查是整改json将对象转为字符串时出现的,报错的原因 ...

  7. JsonMappingException Infinite recursion StackOverflowError

    报错信息 java.lang.RuntimeException: com.fasterxml.jackson.databind.JsonMappingException: Infinite recur ...

  8. Struts2中Result类型介绍

    1.在Struts2中,Result类型有12种,分别为dispatcher,redirect,chain,redirectAction,freemarker,httpheader,stream,ve ...

  9. Python maximum recursion depth exceeded while calling a Python object (gevent的SSL无限递归错误)的问题解决

    报错信息 源码位置 分析 很尴尬,完全看不出原因导致这个报错 解决方法 通过删除代码的方式一部一部删除,找到了问题出处 原因是包的顺序出现了问题,把位置互换一下,发现没有报错了,但是很明确的告诉你这两 ...

最新文章

  1. keep 虚拟路线修改器_螺丝刀【第1期】:如何使用Keep塑造理想身材
  2. (转)JS window对象的top、parent、opener含义
  3. MY_Log,无缝替换原生Log,支持日志输出到文件、FirePHP
  4. 算法竞赛入门经典|习题3-8, 循环小数(UVa202)
  5. oracle alter_log,在线查看alter.log文件内容
  6. Unity3D 使用 GL 绘制线条
  7. 超时尚的UI电子商务PSD分层模板,临摹学习必备
  8. group_concat 排序并取前三个
  9. 排序构造 GYM 101149 F - The Weakest Sith
  10. HTML5权威指南 6.多媒体相关API
  11. 人工智能顶会顶刊以及SCI,IF,核心,分区
  12. Visio Professional详细教程(二)
  13. 十二、React脚手架
  14. 中国十大软件测试网站
  15. php mysql 表情录入_php + mysql 存入表情 【如何转义emoji表情,让它可以存入utf8的数据库】...
  16. 接近开关 NPN PNP
  17. 3d在线展示线上VR全景展示系统
  18. 仅需24小时,带你基于PaddleRec复现经典CTR预估算法
  19. 使用 Learner Lab - 使用 AWS Lambda 将图片写入 S3
  20. 搜狗云输入法,比较cool的输入法

热门文章

  1. 开源移动护理_开源让您的健康护理倍感美好
  2. iOS开发 01-前言 03前景和难易度分析
  3. 基于matlab Simulink的双闭环三相和五相永磁同步电机仿真模型
  4. C与C++中二维数组的动态分配内存方法
  5. 【Effective C++】比较 pass-by-value 与 pass-by-referrence
  6. 计算机主板怎么学,计算机主板的知识!都来学学!
  7. 关于高德地图 所有省的 adcode
  8. macOS从Mojave更新到Catalina之后无法联网的问题
  9. cube-ui 维护记录 —— 前言
  10. Python Pandas 导入dta文件的方法