shiro配置报错
问题描述
全新的测试环境,只加入了spring-boot-starter-web(2.0.3),shiro-spring(1.4.0).
仅添加了一个shiroconfig配置类,内容如下
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author cmit2 on 2019-06-25
* @version 1.0
*/
@Configuration
public class ShiroConfig {
/**
* 配置WebSecurityManager
* @return
*/
@Bean
public SecurityManager securityManager() {
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
return securityManager;
}
@Bean
public ShiroFilterFactoryBean shiroFilterFactoryBean(SecurityManager securityManager)
{
ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
// Shiro的核心安全接口,这个属性是必须的
shiroFilterFactoryBean.setSecurityManager(securityManager);
return shiroFilterFactoryBean;
}
}
运行时有提示:
Bean 'shiroConfig' of type [cn.enfix.test.config.ShiroConfig$$EnhancerBySpringCGLIB$$f8c8c59] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
Bean 'securityManager' of type [org.apache.shiro.web.mgt.DefaultWebSecurityManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
如果将ShiroFilterFactoryBean方法注释掉,以上提示就不会出现了.
请问有何解决方法,非常感谢~~~
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的也是这样的报错,我是再Spring Boot Application上加了@MapperScan注解问题就解决了