温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

关于Infinite recursion detected

发布时间:2020-06-20 11:10:35 来源:网络 阅读:3777 作者:gaochaojs 栏目:开发技术

   在我之前的一篇博文中《基于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环境下,用户点击我的工作中流程名称进入待办任务时,页面报错,如截图所示

关于Infinite recursion detected

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

其代码如下:

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

修改后的如下:

 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,其真实的错误被隐藏了(某表缺少字段)。

  

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI