我正在使用 maven、spring 和 aspectj 进行编译时编织
我的 aspectj 顾问看起来像这样
@Aspect
public class LoggingInterceptor {
private LogManager logManager;
public void setLogManager(LogManager logManager) {
this.logManager = logManager;
}
.....
}
我的 applicationContext.xml 看起来像这样
<!--configures the AspectJ aspect and indicates which Spring context should be used when giving advice-->
<context:spring-configured />
<aop:aspectj-autoproxy/>
<!--<context:component-scan base-package="com.reverb" />-->
<bean id="loggingInterceptor" class="com.myapp.interceptor.LoggingInterceptor">
<property name="logManager" ref="logManager" />
</bean>
logManager 始终为空....