Spring Security的@PreAutoize注释出现问题

Spring Security的@PreAutoize注释出现问题,spring,spring-mvc,spring-security,pre-authentication,Spring,Spring Mvc,Spring Security,Pre Authentication,@PreAuthorize在Spring Security 3中不起作用。这是我的代码快照 @PreAuthorize("hasRole('Admin') or hasRole('Student')") public void doSomething(){} 对于其他感兴趣的人来说,这给了我一个奇怪的错误(请参阅附件) 我通过添加 <aop:config proxy-target-class="true"></aop:config> spring secur

@PreAuthorize
在Spring Security 3中不起作用。

这是我的代码快照

 @PreAuthorize("hasRole('Admin') or hasRole('Student')")
 public void doSomething(){}

对于其他感兴趣的人来说,这给了我一个奇怪的错误(请参阅附件)

我通过添加

<aop:config proxy-target-class="true"></aop:config> 


spring security.xml中的行

您能显示类的全部代码吗?@geoand,我不能在这里添加全部代码,但我确信当我只添加一行时,服务器开始给我错误信息。如果我删除该行,它工作正常。我们需要知道当
@Transactional
@Scheduled
或其他Spring注释时,是否对该类或其任何方法进行了注释,是的。你试过了吗?最有用的是,您可以发布Spring配置感谢@geoand,我通过在Spring-security.xml中添加
行解决了这个问题