开发者

spring aspecjt weaving not working

开发者 https://www.devze.com 2023-02-07 07:23 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消