You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shiro.apache.org by "jglatre (via GitHub)" <gi...@apache.org> on 2025/08/04 06:45:19 UTC
Re: [I] [BeanPostProcessorChecker] WARN o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker [shiro]
jglatre commented on issue #1236:
URL: https://github.com/apache/shiro/issues/1236#issuecomment-3149333044
As a workaround, just avoid exposing `BeanPostProcessor` to Spring, wrap the original `ShiroFilterFactoryBean` in a new `FactoryBean`:
```
@Bean
public FactoryBean<AbstractShiroFilter> shiroFilter(
SecurityManager securityManager,
ShiroFilterChainDefinition chainDefinition,
Map<String, Filter> filters
) {
return new ShiroFilterWrapperFactoryBean( securityManager, chainDefinition.getFilterChainMap(), filters );
}
private static class ShiroFilterWrapperFactoryBean implements FactoryBean<AbstractShiroFilter> {
private final ShiroFilterFactoryBean delegate = new ShiroFilterFactoryBean();
public ShiroFilterWrapperFactoryBean(
SecurityManager securityManager,
Map<String, String> chainDefinitionMap,
Map<String, Filter> filters
) {
delegate.setSecurityManager( securityManager );
delegate.setFilterChainDefinitionMap( chainDefinitionMap );
for (Map.Entry<String, Filter> filter : filters.entrySet()) {
delegate.postProcessBeforeInitialization( filter.getValue(), filter.getKey() );
}
}
@Override
public AbstractShiroFilter getObject() throws Exception {
return (AbstractShiroFilter) delegate.getObject();
}
@Override
public Class<?> getObjectType() {
return delegate.getObjectType();
}
@Override
public boolean isSingleton() {
return delegate.isSingleton();
}
}
```
--
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: issues-unsubscribe@shiro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org
For additional commands, e-mail: issues-help@shiro.apache.org