【问题标题】:Spring insight crashes with "Imbalanced frame stack"Spring Insight 因“不平衡的帧堆栈”而崩溃
【发布时间】:2011-10-11 11:15:19
【问题描述】:

我想使用 spring 洞察力来跟踪我的 spring mvc webapp。启动 tc server 2.5 开发者版时,我的应用程序出现,但我在控制台中看到以下消息:

20.10.2011 09:24:24 com.springsource.insight.intercept.trace.SimpleFrameBuilder enter
FATAL: Frame stack exceeded MAX_FRAMES_PER_TRACE limit or has been aborted limit: 3000 frameCount: 3000 aborted: false
20.10.2011 09:24:24 com.springsource.insight.collection.errorhandling.AdviceErrorHandlingAspect ajc$around$com_springsource_insight_collection_errorhandling_AdviceErrorHandlingAspect$1$e76a6b03
FATAL: Error swallowed in advice adviceexecution(void com.springsource.insight.collection.AbstractOperationCollectionAspect.afterReturning(Object, JoinPoint.StaticPart))

--

java.lang.IllegalStateException: Imbalanced frame stack!  (exit() called too many times)
com.springsource.insight.intercept.trace.ThreadLocalFrameBuilder.exit(ThreadLocalFrameBuilder.java:61)
com.springsource.insight.collection.DefaultOperationCollector.exit(DefaultOperationCollector.java:111)
com.springsource.insight.collection.DefaultOperationCollector.exitNormal(DefaultOperationCollector.java:67)
com.springsource.insight.plugin.springtx.TransactionOperationCollectionAspect.ajc$afterReturning$com_springsource_insight_plugin_springtx_TransactionOperationCollectionAspect$2$e13fb3a0(TransactionOperationCollectionAspect.aj:61)
org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724)
org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393)
org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$afterReturning$org_springframework_transaction_aspectj_AbstractTransactionAspect$3$2a73e96c(AbstractTransactionAspect.aj:78)
...

我可以在这条消息之后调用一些控制器操作,但在某些时候服务器只是拒绝处理我的请求并将相同的堆栈跟踪发送到浏览器。

有人遇到过这个问题吗?即使停用洞察插件annotationhibernatejdbcspring-tx 也无法解决问题。

【问题讨论】:

    标签: java spring spring-mvc stack-frame spring-insight


    【解决方案1】:

    Jon Travis 几乎完全正确,但系统属性是

    -Dinsight-max-frames
    

    如insight-intercept-1.5.1.SR2.jar 中所见,默认值为3000:com.springsource.insight.intercept.trace.FrameBuilder

    将值更改为 -Dinsight-max-frames=6000 为我解决了这个问题。

    【讨论】:

    • 正如@Jon-Travis 在下面提到的那样,该选项不是 -Dinsite.max.frames
    • @chrislovecnm 选项是-Dinsight-max-frames。这与@Jon Travis 所写的内容之间存在非常微妙的区别。注意破折号而不是圆点。
    【解决方案2】:

    其中一些代码在最近的版本中得到了改进。

    您可能想尝试一下 Spring Insight 1.5.1 —— 它与 tc Server 2.6.1 一起提供,可通过 springsource.org/insight 获得

    编辑:您看到的问题是单个 Trace 尝试累积太多帧(默认情况下,它在 1000 处停止计数)。这是因为您的应用程序可能会在启动时执行大量 SQL 调用,或执行大量其他检测调用。一旦检测到这一点,它将停止收集帧并(当前)获得不平衡的帧堆栈。对于您的情况,该错误是良性的。

    您可以通过设置 Java sysproperty (insight.max.frames) 将帧数增加到最大值。

    在 bin/setenv.sh 中,添加到 JVM_OPTS:

    -Dinsight.max.frames=2000
    

    【讨论】:

    • 嗨。谢谢你的提示。现在我只在应用程序启动时收到错误,但只有一次。之后,我可以不受任何限制地使用我的应用程序。也许有人可以告诉我第一个错误的原因,但只要我能启发你的洞察力,一切都很好;)
    • 感谢您的详细解释。事实上,我们在启动时做了很多 SQL 调用。但即使将 insight.max.frames 更改为 50000 也不能修复该消息。我会尝试找出导致错误的语句并尝试优化它们。
    • 顺便说一句:更改 sysproperty 似乎不会影响收集的帧数。上面我可以看到消息:Frame stack exceeded MAX_FRAMES_PER_TRACE limit or has been aborted limit: 3000 frameCount: 3000 aborted: false 不会随 sysproperty 改变
    • 好吧,如果您看到“3000”,那么您的设置肯定会生效。默认值为 1000。
    • 不幸的是没有......我认为 sysproperty 没有效果。即使没有该属性,我也会收到与3000 aborted 相同的消息
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-05-06
    • 1970-01-01
    • 2011-05-22
    • 1970-01-01
    • 1970-01-01
    • 2014-01-10
    • 1970-01-01
    相关资源
    最近更新 更多