Load time weaving for non-spring beans in a spring application

前端 未结 1 1454
一向
一向 2021-01-20 15:12

I have a spring boot application with some REST controllers, service classes and helper classes. The controllers and service classes are spring managed while helper classes

1条回答
  •  囚心锁ツ
    2021-01-20 16:00

    Use -javaagent:/path/to/aspectjweaver-.jar as a startup argument to your JVM to enable load-time weaving. Remove @EnableAspectJAutoProxy from your spring configuration so that spring doesn't try to use it's own Spring AOP framework instead of pure AspectJ. Optionally, create META-INF/aop.xml. Add @EnableSpringConfigured if you want to apply spring configuration to beans not managed by spring (@Configurable POJOs).

    0 讨论(0)
提交回复
热议问题