xczs666 commented on pull request #316: URL: https://github.com/apache/shiro/pull/316#issuecomment-1023241886
@bdemers I tried to fix it rebase on `main`. After modification, a circular dependency error occurs: `ShiroFilterFactoryBean` --_create_--> `AbstractShiroFilter` --_implements_--> `Filter`, `ShiroFilterFactoryBean` --_depends_--> `Filter`(Map<String, Filter> filters).Means `ShiroFilterFactoryBean` both creates and depends on `Filter`. Running `ShiroWebConfigurationTest#testMinimalConfiguration` produces exception: > UnsatisfiedDependencyException: Error creating bean with name 'shiroWebFilterConfiguration': Unsatisfied dependency expressed through field 'filterMap'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'shiroFilterFactoryBean': Requested bean is currently in creation: Is there an unresolvable circular reference? > Please clone https://github.com/xczs666/shiro/tree/bugfix/shiro-829 and run **ShiroWebConfigurationTest.testMinimalConfiguration** to reproduce the above error So I locally removed **filterFactoryBean.setFilters(filterMap)**(line:71) in `org.apache.shiro.spring.web.config.AbstractShiroWebFilterConfiguration`, because `ShiroFilterFactoryBean` will automatically inject Filter Beans through the *postProcessBeforeInitialization(Object, String)* method. Although injecting Spring Filter Beans is redundant, accepting this modification will bring about changes in the use of the **ShiroFilterFactoryBean#setFilter** method, which may cause errors in the user's stock code, and you need your help in evaluating the impact and solutions. Actually in my opinion, in `Spring`, the _setFilters(Map<String, Filter>)_ method should not be provided. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
