spring aspecjt weaving not working
I am using spring security and aspjectj with compile time weaving. I am trying to log successful user login. My pointcut looks as follows. but it is not getting
@Pointcut("execution(* com.myapp.dao.UserDao.loadUserByUsername(..))")
private void pointcutUserLoginLogging() {}
@AfterReturning(pointcut="pointcutUserLoginLogging()")
public void doUserLogging(JoinPoint joinPoint){
}
The method I am trying to inspect has the following signature
public class UserDao extends AbstractDao<User> implements GenericDao<User>, UserDetailsService {
@Transient
public UserDetails loadUserByUs开发者_如何学Goername(String username)
throws UsernameNotFoundException, DataAccessException {
return loadByUsername(username);
}
}
This kind of issue almost always points to build setup problem. Just make sure that the jars that you want to be woven in is in "inpath" and aspects are in "aspectspath". Maven, Ant, Eclipse/AJDT all provide a way to include jars in appropriate paths.
精彩评论