[SHIRO-804] - Avoid conflicts with spring boot aop#268
Conversation
|
@bdemers I'm not a Spring expert so can you review and merge please? |
|
Looks good, we need to figure out what is going on we CI (looks unrelated to this PR) |
Weird because all is green on Jenkins but not in the GH report |
|
@fpapon no, it failed, because GH is using the old jenkins test (5 months ago) from here: |
|
@bmarwell ah ok it's because I checked this build https://ci-builds.apache.org/job/Shiro/job/Shiro-jdk8/view/change-requests/job/PR-268/ |
|
I'd say merge, the new PRs will not have the outdated checks. |
|
@bdemers rebased and pushed as branch:
Once green, we can merge this. |
all is green so I can merge |
If there is a spring-boot-starter-aop dependency in the project's classpath, Spring will automatically create a bean named "org.springframework.aop.config.internalAutoProxyCreator".
This will cause Spring beans to be proxied twice. If one is a JDK dynamic proxy and the other is a CGLIB proxy, then the system will fail to start.
We may be able to avoid such errors by modifying the defaultAdvisorAutoProxyCreator method of the ShiroAnnotationProcessorAutoConfiguration class.
I have tested this modification in my own project and it works. Sorry, my English is not very good, this paragraph is written using Google Translate.
Spring boot log:
ShiroAnnotationProcessorAutoConfiguration#defaultAdvisorAutoProxyCreator: Did not match: - @ConditionalOnMissingBean (names: org.springframework.aop.config.internalAutoProxyCreator; types: org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator; SearchStrategy: all) found beans named org.springframework.aop.config.internalAutoProxyCreator (OnBeanCondition)