Pointcut to intercept all methods in annotated type

  Kiến thức lập trình

In my application, I’m using the following pointcut expression to intercept all methods in classes annotated with my custom annotation.

@Pointcut("@target(io.github.jamestrandung.memoize.Memoized) && execution(* *(..))")
public void methodInMemoizedType() {
}

When I start my SpringBoot app, I keep getting the error below.

Caused by: java.lang.IllegalArgumentException: Cannot subclass final class org.springframework.boot.autoconfigure.AutoConfigurationPackages$BasePackages

I tried to shorten my pointcut expression to execution(* *(..) and got exactly the same error and I can understand why. However, this means the 1st part of my expression @target(io.github.jamestrandung.memoize.Memoized) has no effects at all.

I’d be very grateful if you could tell me what I did wrong.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT