Spring security spring framework security@preauthorize注释在osgi中不起作用

Spring security spring framework security@preauthorize注释在osgi中不起作用,spring-security,osgi,eclipse-virgo,Spring Security,Osgi,Eclipse Virgo,我正在使用osgi和基于spring注释的配置。(使用virgo部署应用程序) @方法impl上的预授权批注不起作用 它允许用户在没有角色的情况下访问它。 若我在接口上放置相同的注释,它会为所有用户抛出AccessDenied异常。 例外情况: org.springframework.security.access.AccessDeniedException: Access is denied 252881 [http-bio-8080-exec-3] ERROR c.w.HomeContr

我正在使用osgi和基于spring注释的配置。(使用virgo部署应用程序)
@方法impl上的预授权批注不起作用
它允许用户在没有角色的情况下访问它。

若我在接口上放置相同的注释,它会为所有用户抛出AccessDenied异常。 例外情况:

org.springframework.security.access.AccessDeniedException: Access is denied 
 252881 [http-bio-8080-exec-3] ERROR c.w.HomeController  - handleAccessDeniedException####Access is denied 
    at org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:71) 
    at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:203
    at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) 
    at $Proxy421.save(Unknown Source) 
    at c.w.controllers.HomeController.home(HomeController.java:125) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:597) 
    at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) 
    at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapte
    at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414) 
这是我的配置:

  <bean id="expressionHandler"
      class="org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler">
        <property name="permissionEvaluator" ref="aclPermissionEvaluator"/>
  </bean>
  <global-method-security pre-post-annotations="enabled" run-as-manager-ref="runAsManager"
    secured-annotations="enabled">
    <expression-handler ref="expressionHandler" />
  </global-method-security> 


我使用的是spring security 3.0.4。RELEASE

我在一个包中使用了@Preauthorize注释,在另一个包中使用了定义的全局方法安全性
该问题在移动到同一捆绑包后得到修复