关于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,如需转载请自行联系原作者


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值