spring-aspects

spring autowired aop circular dependency

拜拜、爱过 提交于 2019-12-03 04:14:53
问题 I'm using java config with @ComponentScan in order to initialize my beans and @EnableAspectJAutoProxy(proxyTargetClass=true) to use cglib proxies. In this project we have a lots of generated services autowired between them using @Autowired . It works pretty well. But, for some of these services I've added @Async (I've also added @EnableAsync(proxyTargetClass = true) on my @Configuration class). After that, I'm getting: Caused by: org.springframework.beans.factory

spring autowired aop circular dependency

蓝咒 提交于 2019-12-02 18:07:53
I'm using java config with @ComponentScan in order to initialize my beans and @EnableAspectJAutoProxy(proxyTargetClass=true) to use cglib proxies. In this project we have a lots of generated services autowired between them using @Autowired . It works pretty well. But, for some of these services I've added @Async (I've also added @EnableAsync(proxyTargetClass = true) on my @Configuration class). After that, I'm getting: Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'ConversationUserLocalService': Bean with name

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

空扰寡人 提交于 2019-12-02 02:08:37
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 are not spring managed and mostly contain static methods. The AspectJ configuration is present in java configuration as follows @Configuration @EnableLoadTimeWeaving(aspectjWeaving = AspectJWeaving.ENABLED) public class AspectConfig { @Bean public LoggingAspect loggingAspect() { return new LoggingAspect(); } } The corresponding LoggingAspect class is as follows, @Aspect public class LoggingAspect { @Before(