Spring autowired bean for @Aspect aspect is null

后端 未结 9 1082
离开以前
离开以前 2020-11-29 03:42

I have the following spring configuration:





        
9条回答
  •  伪装坚强ぢ
    2020-11-29 03:50

    Use compile time weaving, see for plugin example at: https://github.com/avner-levy/minimal_spring_hibernate_maven_setup/blob/master/pom.xml

    The following combination of annotation and Spring config works for me thanks to notes above by Tobias/Willie/Eric:

    Class:

    package com.abc
    @Configurable
    @Aspect
    public class MyAspect {
       @Autowired
       protected SomeType someAutoWiredField;
    }
    

    XML:

    
    
    

提交回复
热议问题