Announcement Announcement Module
No announcement yet.
PerformanceMonitorInterceptor implementation problems Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • PerformanceMonitorInterceptor implementation problems

    Hi, i'm trying to obtain an estimate for a particular method's execution time. The performanceMonitorInterceptor seems to be just what i'm looking for.
    My interface is:
    One of the implementing classes:

    Here is my bean spec:
    <bean id="performanceInterceptor" class="org.springframework.aop.interceptor.PerformanceMonitorInterceptor"/>
    <bean id="simpleQueue" class=""/>
    <bean id="pService" class="org.springframework.aop.framework.ProxyFactoryBean">
                <property name="proxyInterfaces">
                <property name="target">
                    <ref bean="simpleQueue"/>
                <property name="interceptorNames">
    I don't see any errors starting up my server , so bean initialization goes ok. But i don't see any log statements when any of the implemented methods from the interface are called in my "target" class.
    I use log4j for our logging. Now, there might be a conflict or a mismatch, i'm not sure, with commons logging.
    Putting the logger for thewhole application in debug, doesn't show me *any* indication that the interceptor method is being called.
    I even subclassed the performanceMonitorInterceptor and changed just the logger to use log4j and still to no avail.
    I even have the latest CGLIB library. I'm not sure what i'm missing.
    Any help or suggestions will be appreciated.

  • #2

    I realized that the reason i didn't see the interceptor kicking in at any point was because i was calling the actual bean instead of the proxyFactoryBean. Once i changed that, i can see the stopwatch debug code; but this happens only when *one* of the interface methods is being called, and not the rest. I'm not sure why this is happening.
    Any help would be appreciated. Thanks in advance.


    • #3
      got it...

      The xml bean spec i wrote above is right. I found out that there was an error with the way i was testing this.
      Thanks everybody.


      • #4
        Have the same problem


        i have the same configuration as you and see no output of the interceptor. For my testcase I set up an application-context, similar to yours and receive my service from this context. I also use the proxy, like pService.

        I don't use log4j. Also the output say to me
        INFO: CGLIB2 available: proxyTargetClass feature enabled

        any suggestions?