[
https://issues.apache.org/jira/browse/SHIRO-732?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16995895#comment-16995895
]
jiahua_lan commented on SHIRO-732:
----------------------------------
I do not quite understand you. If you ask me a solution to this problem. I
really have nothing to think about, the reason is that the default
*shiroFilterChainDefinition* bean doesn't seem to be overridden. I think if you
add the *@ConditionalOnMissingBean* annotation to the configuration of
*org.apache.shiro.spring.web.config.ShiroWebConfiguration*, this problem should
be solved. In this case, *shiroFilterChainDefinition* will not be configured in
advance, and other bean dependencies will be resolved and created Later, it
will be configured if it still does not exist. In addition, I found that the
*org.springframework.context.annotation.DependsOn* annotation was imported into
*org.apache.shiro.spring.web.config.ShiroWebConfiguration*, but it was not used
in the class. Is it possible: a bean in this class originally depends on beans
from other places, but due to negligence or other reasons, this annotation is
not used, affecting the order of configuration loading?
> Configuration conflict
> ----------------------
>
> Key: SHIRO-732
> URL: https://issues.apache.org/jira/browse/SHIRO-732
> Project: Shiro
> Issue Type: Question
> Components: Configuration
> Affects Versions: 1.4.2
> Reporter: jiahua_lan
> Priority: Major
>
> When I used shiro-spring-boot-web-starter, I found that the configuration of
> both *org.apache.shiro.spring.web.config.ShiroWebConfiguration* and
> *org.apache.shiro.spring.config.web.autoconfigure.ShiroWebAutoConfiguration*
> seems to be Conflict with each other. One bean is defined in
> *org.apache.shiro.spring.config.web.autoconfigure.ShiroWebAutoConfiguration*,
> the bean id is shiroFilterChainDefinition, and it will be declared when there
> are no beans of the same type in the IOC container. And
> *org.apache.shiro.spring.web.config.ShiroWebConfiguration* also has a bean
> declaration with a bean id of shiroFilterChainDefinition, without any
> conditions, and both classes have @Configuration annotations, which means
> that when the classpath is at the same time When there are two classes, the
> configuration of shiroFilterChainDefinition in
> org.apache.shiro.spring.config.web.autoconfigure.ShiroWebAutoConfiguration
> does not take effect. I also cannot replace the default configuration by
> configuring shiroFilterChainDefinition myself. If I configure
> shiroFilterChainDefinition in my project it will appear *[The bean
> 'shiroFilterChainDefinition', defined in class path resource [xxxx], could
> not be registered. A bean with that name has already been defined in class
> path resource [org / apache / shiro / spring / web / config /
> ShiroWebConfiguration.class] and overriding is disabled.]* and the project
> fails to start. Can this be counted as a bug? Or is there any other solution?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)