Search code examples
javaspringspring-bootaopspring-aop

Get a reference of current proxy in Spring boot


Anyone know how to get a reference of the current proxy in a class with @Service annotation in Spring boot?

AopContext.currentProxy() doesn't work, it says that need to set exposeProxy to true, but I've no idea how to do it with Spring boot.


Solution

  • There was a bug related but it was resolved on Spring 4.3.1.

    Now you can set @EnableAspectJAutoProxy(exposeProxy=true)