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

  • Ordering Prox

    Fellow SpringSorcerers,

    We have 2 point cuts. One that targets all of the services in our application and perform logging ( See below).

        <aop:aspect ref="TraceLogger" order="2">
            <aop:pointcut id="theExecutionOfServiceMethod"
            <aop:around pointcut-ref="theExecutionOfServiceMethod"
    The other targets a subset of these services and serializes the method call on that service to a queue to be executed asynchronously (below). As you can see the point cut advisor below is applied to beans named in a particular way (ie: ending with _AsyncService).

    <bean id="beanNameProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
     <property name="order" value="0"/>
     <property name="beanNames">
     <property name="interceptorNames">
    Both are supplying the order parameter to specify which should be executed first.

    However, when the code reaches the "delegatorAdvice" which should be executed fist (per lower order number), the class name of the target is something like "$Proxy..." (since it is already proxied out by Spring), which creates an issue for us as we depend on being able to retrieve the appropriate class name of the target. If we disable the first pointcut mentiond ( TraceLogger ) everything works fine.

    Thank you.

  • #2
    The easy solution, don't mix proxy solutions either use aop:config or use the autoproxy stuff not both. Both proxy solutions are processed one by one instead of in one big go.


    • #3
      Confirming that changing everything to "aop:config" solution solved the problem.

      Thank you Marten.