You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shiro.apache.org by "George Cao (Jira)" <ji...@apache.org> on 2022/10/07 04:01:00 UTC

[jira] [Created] (SHIRO-890) Avoid another proxy creator when @EnableAspectJAutoProxy enabled

George Cao created SHIRO-890:
--------------------------------

             Summary: Avoid another proxy creator when @EnableAspectJAutoProxy enabled
                 Key: SHIRO-890
                 URL: https://issues.apache.org/jira/browse/SHIRO-890
             Project: Shiro
          Issue Type: Improvement
          Components: Integration: Spring
    Affects Versions: 1.9.1
            Reporter: George Cao
            Assignee: Les Hazlewood


There is already an issue created [https://issues.apache.org/jira/projects/SHIRO/issues/SHIRO-804.]

But when @EnableAspectJAutoProxy enabled, spring actually creates an instance of  AnnotationAwareAspectJAutoProxyCreator but not {color:#000000}DefaultAdvisorAutoProxyCreator.  In this situation, there will be two proxy creator in the same context, which leads to methods be proxied twice also . {color}

{color:#000000}The fix may remove the type value of the @ConditionalOnMissingBean.{color}
{code:java}
@Bean
@DependsOn("lifecycleBeanPostProcessor")
@ConditionalOnMissingBean(name = AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME)
@Override
public DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator() {
    return super.defaultAdvisorAutoProxyCreator();
}
 {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org
For additional commands, e-mail: issues-help@shiro.apache.org