2011-10-11 93 views
8

我想用spring insight来跟踪我的spring mvc webapp。当启动TC服务器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) 
... 

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

有没有人有这个问题的经验?即使停用洞察插件annotation,hibernate,jdbcspring-tx也不会解决问题。

回答

8

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

-Dinsight-max-frames 

的默认值是3000所看到的洞察力截距-1.5.1.SR2.jar:com.springsource.insight.intercept.trace.FrameBuilder

的值更改为-Dinsight-max-frames=6000固定我的问题。

+0

,因为@ Jon-Travis在下面提到的选项不是-Dinsite.max。帧 – chrislovecnm

+0

@chrislovecnm选项是'-Dinsight-max-frames'。这与@Jon Travis写的非常微妙的区别。注意破折号而不是点。 –

8

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

你可能想给春天的Insight 1.5.1一试 - 它带有TC服务器2.6.1,可通过springsource.org/insight

编辑可用:你所看到的问题是,一个单一的跟踪试图累积太多帧(默认情况下,它停止计数1000)。这是因为您的应用程序在启动时可能会执行大量的SQL调用,或者其他很多仪表化调用。一旦检测到它,它将停止收集帧并且(当前)得到不平衡的帧堆栈。这个错误对你的情况非常重要。

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

在滨/ setenv.sh,只需添加到JVM_OPTS:

-Dinsight.max.frames=2000 
+0

嗨。谢谢你的提示。现在我只在应用程序启动时出错,但只有一次。之后,我可以不受任何限制地使用我的应用程序。也许有人可以告诉我第一个错误的原因,但只要我能够洞察力,一切都很好;) – powerMicha

+0

感谢您的详细解释。事实上,我们在启动时正在进行大量的SQL调用。但即使将insight.max.frames更改为50000也不能修复该消息。我将尝试找出哪些语句导致错误并尝试优化它们。 – powerMicha

+0

Btw:更改sysproperty似乎不会影响收集的帧数。上面我可以看到这样的信息:'帧堆栈超出MAX_FRAMES_PER_TRACE限制或已被中止限制:3000 frameCount:3000中止:false'不会随sysproperty更改 – powerMicha