My Application class
import com.example.haha.Haha;
import com.example.hehe.Hehe;
import com.example.logging.Logging;
import org.springframework.beans.factory
Your allPublicMethods
pointcut is too broad. It's being applied to every public method of every class. One class that matches is org.springframework.boot.autoconfigure.AutoConfigurationPackages$BasePackages
. It's declared as final
which prevents the advice from being applied to it.
You should narrow the scope of your pointcut, for example by only applying it to code in your own com.example
package:
@Pointcut("execution(public * com.example..*(..))")
Your Pointcut is so generic:
@Pointcut("execution(public * *(..))")
That will advice all available public methods of every class on the classpath, every single of them! Unfortunately, Spring AOP can't make the required proxy for some present classes on the classpath (Since they're not implementing any interface and are final
), hence the error:
Cannot subclass final class org.springframework.boot.autoconfigure.AutoConfigurationPackages$BasePackages
If you restrict your pointcut to just advice your classes, you would be fine!