SpringSecurity集成启动报 In the composition of all global method configuration, no annotation support was actually activated 异常
异常内容:
Caused by: java.lang.IllegalStateException: In the composition of all global method configuration, no annotation support was actually activated
at org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration.methodSecurityMetadataSource(GlobalMethodSecurityConfiguration.java:373) ~[spring-security-config-5.3.3.RELEASE.jar:5.3.3.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_242]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_242]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_242]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_242]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:650) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
导致的原因是
@EnableGlobalMethodSecurity注解 prePostEnabled 属性,是否开启 PreAuthory 注解功能,类似的还有其他注解,Secured注解等等,这些注解的默认值都是false,也就是不启用

解决方法就是配置以下就可以了:
@EnableGlobalMethodSecurity(prePostEnabled = true)
SpringSecurity集成启动报 In the composition of all global method configuration, no annotation support was actually activated 异常的更多相关文章
- Jetty启动报Error scanning entry META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class
近日在项目中集成Elasticsearch后,Jetty启动报错. 错误日志如下: Suppressed: |java.lang.RuntimeException: Error scanning en ...
- SpringBoot项目启动报错:java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \( ( )\___ | '_ | '_| | ...
- SpringBoot集成MybatisPlus报错
SpringBoot集成MybatisPlus报错 启动的时候总是报如下错误: java.lang.annotation.AnnotationFormatError: Invalid default: ...
- Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误——SHH框架
SHH框架工程,Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误 1.查看配置文件web.xml中是否配置.or ...
- 【原】tomcat 7 启动报错:java.lang.NoSuchMethodError: javax.servlet.ServletContext.getSessionCookieConfig()Ljavax/servlet/SessionCookieConfig的解决
现象: tomcat 7 启动报错:java.lang.NoSuchMethodError: javax.servlet.ServletContext.getSessionCookieConfig() ...
- Oracle启动报错ORA-03113解决
环境:RHEL6.4 + Oracle 11.2.0.4 步骤摘要:1.启动报错ORA-031132.查看alert日志查找原因3.根据实际情况采取合理的措施,这里我们先增加闪回区大小,把库启动起来4 ...
- Oracle启动报错ORA-27102解决
环境:RHEL5.5 + Oracle 10.2.0.4 此错误一般是因为数据库的初始化参数文件的内存设置不当导致.本例是因为操作系统参数设置问题导致. 当前现象:Oracle启动报错ORA-2710 ...
- Tomcat启动报错整理
1.启动报 Connector attribute SSLCertificateFile must be defined when using SSL with APR conf\server.xml ...
- freebsd启动报错:My unqualified host name unkown...Sleeping for retry.
原文 http://blog.163.com/sujoe_2006/blog/static/335315120111158576591/ 病状:启动报"My unqualified host ...
随机推荐
- 搭建开源跳板机——jumpserver
搭建开源跳板机mobaxterm 官方文档:https://jumpserver.readthedocs.io/zh/master/ $ yum update -y # 防火墙 与 selinux 设 ...
- 巧用 CSS 把图片马赛克化
一.image-rendering 介绍 CSS 中有一个有趣的特性叫 image-rendering,它可以通过算法来更好地显示被缩放的图片. 假设我们有一张尺寸较小的二维码截图(下方左),将其放大 ...
- [文档]运维故障报告template
RCA的基本概念 根本原因分析技术(root cause analysis,RCA). IOWA州立大学质量管理学院认为,很多公司在设备发生故障后,都能够很快修复, 但难以发现故障的根本原因,所以此故 ...
- 答疑记录:jmeter从返回的html中提取指定内容
返回的html(截取部分),要求从中提取:2022-02-22 13:46:15 <!-- 前面省略557行 --> <td>2022-02-22</td> < ...
- 『无为则无心』Python面向对象 — 60、魔法属性
目录 1.魔法属性__name__ 2.魔法属性__bases__ 3.魔法属性__mro__ 4.魔法属性__doc__ 5.魔法属性__module__ 和__class__ 6.魔法属性__di ...
- 100G/40G/25G/10G网络测试解决方案
一.100G概述 随着CDN等视频直播业务和P2P业务的快速发展,带宽的要求越来越高.当前5G业务势头正盛,其基于400G的主干网络通信业务也在积极部署之中.但当前在很多的业务场景中,100G系统的部 ...
- vmware启动后虚拟机无法联网
搜索services.msc打开服务 确认VMware NAT service和VMware DHCP service服务处于启动状态:开启自动启动,下次就会自动联网了. VMware Authori ...
- Leaflet:Path、Polyline、Polygon、Rectangle、Circle、CircleMarker
下边介绍Vector Layer Path(Layer) Path是其他Vector Layer的父类,比如Polyline.Polygon.Rectangle.Circle.CircleMarker ...
- vue初步构建项目
新建项目文件夹 在当前文件夹打开命令行工具(shift+右键-->在次此处打开命令窗口) npm install -g vue-cli npm init webpack npm install ...
- 借助DBHelper实现学生管理案例分析
一.案例功能的实现 数据: --专业 create table ProfessionInfo ( ProfessionID int primary key identity(1,1), --专业编号 ...