Announcement Announcement Module
Collapse
No announcement yet.
My @aspect stopped working! Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • My @aspect stopped working!

    Hi guys, I wonder if you can help me, this was working fine for me:

    Code:
    <aop:aspectj-autoproxy/>
    <bean id="profileAspect" class="com.xxx.profile.aop.MethodProfiler"/>
    
    @Aspect
    public class MethodProfiler {
    
     @Around(value="@annotation(com.xxx.profile.marker.Profile)")
      public Object profileMethod(ProceedingJoinPoint pjp) throws Throwable {    
        
         ...
      }
    }
    It has been working fine for the last month (for all methods annotated with @Profile, was printing the time to complete).

    Last week it stopped working. It simply died, no errors, no warnings, no nothing, just nothing happens.

    I reviewed the changes on the repository of my project, and I found that someone:

    1) added the cglib dependency on the classpath
    2) replaced an old custom filter with the spring org.springframework.web.filter.DelegatingFilterPro xy on the web.xml file
    3) added an aop bean to the applicationContext.xml
    <bean id="sessionShoppingCart" class="com.xxx.model.ShoppingCart" scope="session">
    <aop:scoped-proxy/>
    </bean>

    It's really difficult for me to rollback each change and see which is affecting the aspect, do you guys have any ideas?

    I'm using spring 2.5, and I feel really sad about this. Any help will be appreciated.
    Last edited by sercasti; Feb 16th, 2010, 12:33 PM.

  • #2
    just found out what made it to stop working...

    the dispatcher-servlet.xml changed from :

    <context:component-scan base-package="com.xxx.controller" />

    to

    <context:component-scan base-package="com.xxx.*" />
    -
    and there was the problem... I really dont understand how this context:component-scan works, and why using the wildcard * made my aspect to stop working.

    Comment

    Working...
    X