maven的ssm项目使用security安全框架的注解支持时,启动报这个错误
- java.lang.IllegalStateException: BeanFactory not initialized or already closed - call ‘refresh’ before accessing beans via the ApplicationContext
是因为在spring-security.xml配置文件中
<security:global-method-security jsr250-annotations="enabled"/>
<security:global-method-security pre-post-annotations="enabled"/>
<security:global-method-security secured-annotations="enabled"/>
-支持注解方式的配置文件代码写错,应为
<security:global-method-security secured-annotations="enabled" pre-post-annotations="enabled" jsr250-annotations="enabled"/>