springboot @Configuration获取不到@value配置问题

转博主:http://blog.csdn.net/liubinblog/article/details/77944053

原博如下:

springboot 与shiro整合是发现@value获取不到值,

弄了很久才发现

配置Shiro是多了这个配置

shiro生命周期处理器

[java]  view plain  copy
  1. public LifecycleBeanPostProcessor getLifecycleBeanPostProcessor() {  
  2.         return new LifecycleBeanPostProcessor();  
  3.     }  
去掉就可以了(暂时不知道为什么)



原博评论区也不错:

@Bean
public static LifecycleBeanPostProcessor lifecycleBeanPostProcessor() {
return new LifecycleBeanPostProcessor();
}

我也遇到该问题,stackoverflow上有人说加上static ,亲测可用

猜你喜欢

转载自blog.csdn.net/vcstrong/article/details/79273054