在-servlet.xml配置context:component-scan後,Spring在掃描包時,會將全部帶 @Service註解的類都掃描到容器中。而-servlet.xml和applicationContext.xml不是同時加載。等到加載applicationContext.xml時,因爲容器中已經存在service類,使得cglib將不對service類進行代理,致使的結果就是applicationContext中的aop配置不起做用。app