Methods that use the AOP, parent class in Spring boot are not intercepted

there are two classes. There are methods in parent class A, funA, subclass B, and method funB, aspect configuration class B is configured for all methods in subclass B. now it is effective to call the methods in B, but using B to call the method funA, in A does not execute the configuration aspect method. Is there any way to solve this problem?

Sep.28,2021

wrote a pointcut for the parent class alone, which solved


should be able to override the method of the parent class in the subclass, and then call the method of the parent class directly, so that only one pointcut needs to be configured

@Override
public String toString() {
    return super.toString();
}

can also be overridden by subclasses and the interface can be defined, but the inherited methods in the interface are not allowed either. Spirngboot version 2.1.4

Menu