8

I want to use spring insight to trace my spring mvc webapp. When starting up the tc server 2.5 developer edition, my application comes up but I see following message in the console:

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)
...

I can call some controller actions after this message, but at some point the server just refuses to handle my requests and sends the same stack trace to the browser.

Did anyone have experience with this problem? Even deactivating insight plugins annotation, hibernate, jdbc or spring-tx does not sove the problem.

powerMicha
  • 2,753
  • 1
  • 24
  • 31

2 Answers2

8

Some of this code has been improved in recent versions.

You may want to give Spring Insight 1.5.1 a try -- it comes with tc Server 2.6.1 and is available via springsource.org/insight

EDIT: The issue you are seeing is that a single Trace has attempted to accumulate too many frames (by default it stops counting at 1000). This is because your application may be doing a lot of SQL calls at startup, or a lot of other instrumented calls. Once this is detected, it will stop collecting frames and (currently) get a imbalanced frame stack. The error is benign for your case.

You can increase the # of Frames to max out at by setting a Java sysproperty (insight.max.frames).

In bin/setenv.sh, just add to JVM_OPTS:

-Dinsight.max.frames=2000
Jon Travis
  • 303
  • 2
  • 8
  • Hi. Thank you for this hint. Now I only get the error at application startup, but only once. Afterwards I can work with my application without any limitations. Maybe someone can tell me a reason for the first error, but as long as I can you spring insight, everything is fine ;) – powerMicha Oct 13 '11 at 06:56
  • Thanks for your detailed explanation. Indeed we are doing a lot SQL calls at startup. But even changing insight.max.frames to 50000 does not fix the the message. I will try to figure out which statements are causing the error and try to optimize them. – powerMicha Oct 20 '11 at 06:54
  • Btw: Changing the sysproperty seem not to effect the # of frames collected. Above I can see the message: `Frame stack exceeded MAX_FRAMES_PER_TRACE limit or has been aborted limit: 3000 frameCount: 3000 aborted: false` which does not change with the sysproperty – powerMicha Oct 20 '11 at 07:26
  • Well if you are seeing '3000', then your setting is definitely taking effect. The default is 1000. – Jon Travis Oct 21 '11 at 15:18
  • 1
    Unfortunatly not... I think that the sysproperty has no effect. Even without the property I get the same message with `3000 aborted` – powerMicha Oct 24 '11 at 06:05
  • @JonTravis if you update your answer with 3000 as the default num frames and insight-max-frames instead of insight.max.frames, I'll delete my answer and your answer can be the accepted one – Brad Cupit Jan 05 '12 at 15:12
8

Jon Travis is almost exactly right, but the system property is

-Dinsight-max-frames

The default value is 3000 as seen in insight-intercept-1.5.1.SR2.jar: com.springsource.insight.intercept.trace.FrameBuilder

Changing the value to -Dinsight-max-frames=6000 fixed the issue for me.

Community
  • 1
  • 1
Brad Cupit
  • 6,530
  • 8
  • 55
  • 60