Results 1 to 2 of 2

Thread: AspectJ/Spring/OSGI: advice for some pointcuts fires, but not others

  1. #1
    Join Date
    Nov 2011
    Posts
    4

    Default AspectJ/Spring/OSGI: advice for some pointcuts fires, but not others

    Hello,

    I am trying to get AspectJ LTW working with my Spring 3.1.0.M2/OSGI setup. Target class implements a public interface. I have advice for 2 of the methods on the interface working
    - one method takes some params and return a collection
    - one method takes no param and return an object

    but 2 advice for 2 other methods also on the same interface implemented by the same class do not get invoked:
    - one method takes no param and return a Set
    - one method takes some params and return void

    I tried to find debug/trace info following instructions in http://www.eclipse.org/aspectj/doc/r...ide/index.html. But do not get anything useful in log/console.

    Any suggestion how to diagnose/resolve this issue?

    Following the info in Spring doc: http://static.springsource.org/sprin...tml#aop-aj-ltw, I add following to my pom.xml:

    Code:
    		<dependency>
    		 <groupId>org.springframework</groupId>
    		 <artifactId>org.springframework.aspects</artifactId>
    		 <version>3.1.0.RELEASE</version> 
    		</dependency>
    		<dependency>
    			<groupId>com.springsource.org.aspectj</groupId>
    			<artifactId>weaver</artifactId>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>aop</artifactId>
    		</dependency>
    In my context.xml, I added:

    Code:
    	<!--  Allow proxys -->
        <aop:aspectj-autoproxy />    
        
        <!-- this switches on the load-time weaving -->
        <context:load-time-weaver
            weaver-class="org.springframework.instrument.classloading.SimpleLoadTimeWeaver"/>

    Thx
    Chuck

  2. #2
    Join Date
    Dec 2009
    Location
    India
    Posts
    108

    Default

    Are you sure that you're not calling the two methods from within your proxied class because it is not supported by Spring AOP. read reference docs for details

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •