Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7434835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:57:24+00:00 2026-05-29T09:57:24+00:00

I am getting started with AOP for the first time. I have my first

  • 0

I am getting started with AOP for the first time.

I have my first aspect as follows:

@Aspect
public class SyncLoggingAspect {
    private final Logger logger = Logger.getLogger(this.getClass());

    @Before("execution(public * *(..))")
    public void anyPublic() {
        System.out.println("HIT POINTCUT");
    }
}

This sucessfully proceeds to be invoked on any method call which is public. However when I change it to this:

@Before("execution(public * doPoll(..))")
public void anyPublic() {
    System.out.println("HIT POINTCUT");
}

I would expect it to work on any public method called “doPoll”, yet when a method such as this is called nothing happens:

public class GmailContactPoller extends ContactPoller<GoogleUser, ContactPusher<GoogleUser>> {
    Logger logger = Logger.getLogger(this.getClass());

    @Override
    public List<? extends ContactPusher<GoogleUser>> doPoll() throws PollException {
           ...
    }
}

Is there something I am missing with the EL syntax? Or is this something to do with the inheritance hierarchy? The superclass method of doPoll is abstract in an abstract class called Poller. Does not having an interface cause problems?

Edit: I just noticed my IDE enables spring aspect tooling, and now I have the following compiler warning by the method:

“Description Resource Path Location Type
advice defined in datasync.aop.aspects.SyncLoggingAspect has not been applied [Xlint:adviceDidNotMatch] SyncLoggingAspect.java /DataSync/src/main/datasync/aop/aspects”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:57:24+00:00Added an answer on May 29, 2026 at 9:57 am

    Spring AOP Proxies and aspectJ had some differences mainly:

    • Spring AOP only works on public methods.
    • Spring AOP does not work for self invocations.

    You can have a look to sections 8.4 & 8.5 of Spring’s Documentation for more information.

    Currently you have two solutions:

    1. refactor your code to remove the need for self invocation
    2. use AspectJ rather than Spring AOP proxies either at compile time or load time.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just getting started with Boost for the first time, details: I'm using Visual
I'm just getting started working with foreign keys for the first time and I'm
Just getting started using MVC in ASP.NET, I'm going to have it so users
I'm getting started with Silverlight. When creating a new solution I have the option
I am getting started with HAML and am working on my converting my first
I am just getting started with Silverlight and have recently added a Silverlight project
Getting started on writing my first build script. I dont get the whole dependency
Just getting started with MSpec and I can't seem to quite get my first
Just getting started with Obj-C and iOS programming. I have some code that loads
I'm getting started with Node.js and I'm having a hard time figuring out what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.