报错信息:

8:42:12.529 [restartedMain] ERROR o.s.b.w.e.t.TomcatStarter - [onStartup,61] - Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'corsFilter' defined in class path resource [com/ruoyi/framework/config/ResourcesConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.filter.CorsFilter]: Factory method 'corsFilter' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.web.cors.CorsConfiguration.addAllowedOriginPattern(Ljava/lang/String;)V
18:42:12.597 [restartedMain] ERROR o.s.b.d.LoggingFailureAnalysisReporter - [report,40] - ***************************
APPLICATION FAILED TO START
*************************** Description: An attempt was made to call a method that does not exist. The attempt was made from the following location: com.ruoyi.framework.config.ResourcesConfig.corsFilter(ResourcesConfig.java:57) The following method did not exist: org.springframework.web.cors.CorsConfiguration.addAllowedOriginPattern(Ljava/lang/String;)V The method's class, org.springframework.web.cors.CorsConfiguration, is available from the following locations: jar:file:/D:/z_GreenTools/repository/org/springframework/spring-web/5.2.12.RELEASE/spring-web-5.2.12.RELEASE.jar!/org/springframework/web/cors/CorsConfiguration.class It was loaded from the following location: file:/D:/z_GreenTools/repository/org/springframework/spring-web/5.2.12.RELEASE/spring-web-5.2.12.RELEASE.jar

解决方法:

  • 找到如图路径:修改方法:config.addAllowedOriginPattern("*");

  • 修改为:config.addAllowedOrigin("*");

The attempt was made from the following location: com.ruoyi.framework.config.ResourcesConfig.corsFilter(ResourcesConfig.java:57)的更多相关文章

  1. js 利用iframe和location.hash跨域解决的方法,java图片上传回调JS函数跨域

    奶奶的:折腾了我二天,最终攻克了!网上有非常多样例. 但跟我的都不太一样,费话不多说了,上图   上代码: IE ,firefix,chrome 測试通过 js :这个主页面,部分代码, functi ...

  2. tomcat启动异常(严重: Dispatcher initialization failed Unable to load configuration. - [unknown location] )

    严重: Dispatcher initialization failed Unable to load configuration. - [unknown location] at com.opens ...

  3. Nginx 笔记与总结(6)Location:精准匹配

    在 /usr/local/nginx/conf/nginx.conf 的 server 段中,location 表示根据 URI 来进行不同的定位:把网站的不同部分定位到不同的处理方式上,例如遇到 . ...

  4. --@angularjs-- $location.path('/login')-$location服务用法示例

    $httpProvider interceptor .factory('auth403', ['$rootScope', '$q', '$location', function auth403($ro ...

  5. struts异常:Caused by: Parent package is not defined: json-default - [unknown location]解决办法

    问题描述: Unable to load configuration. - [unknown location] at com.opensymphony.xwork2.config.Configura ...

  6. In action "Setting JDBC driver jar location unix [Set a variable]" (screen "Select a Database [Configurable banner form]"), property "Script":

    java.lang.Exception: JDBC Driver Jar not found. Looking for: /u01/oracle/GG_Director/ERROR: Unresolv ...

  7. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.

    好久没有冒泡了,最近在新环境上搭建应用时,启动报错: INFO: Illegal access: this web application instance has been stopped alre ...

  8. 开发Spring过程中几个常见异常(二):Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'a' define

    本异常是小编在运行自己另外一篇博文中的例子时遇到的.(附博文:http://www.cnblogs.com/dudududu/p/8482487.html) 完整异常信息: 警告: Exception ...

  9. java.lang.IllegalStateException: Failed to load property source from location 'classpath:/application-dev.yml'

    如果你的项目没有配置错误,配置文件名称也正常,还出现这个问题,那一定是你的yml文件编码的问题 先附上一张项目架构图 当我启动服务器寻找配置文件的时候,服务器提示这样的错误信息 java.lang.I ...

  10. nginx rewrite和根据url参数location

    最近项目中涉及到旧老项目迁移,需要在nginx上做些配置,所以简单学习了下,好记性不如烂笔头,先记下来. rewrite 首先查看下nginx是否支持rewrite: ./nginx -V 不支持说明 ...

随机推荐

  1. #分治,Dijkstra#洛谷 3350 [ZJOI2016]旅行者

    题目 给定一张\(n*m\)的网格图,\(q\)次询问两点之间距离 \(n*m\leq 2*10^4,q\leq 10^5\) 分析 首先floyd会TLE,考虑两点间距离可以由两段拼凑起来, 那么枚 ...

  2. 配置java.library.path加载库文件

    前言:本文将告诉你Java加载dll或so库文件,配置 java.library.path路径 规避异常:java.lang.UnsatisfiedLinkError: no XXX in java. ...

  3. 重新点亮shell————sed其他命令[十一]

    前言 简单介绍一下其他增删查. 正文 删除命令: 例子: 插入和更改: 例子i: 例子c: 读文件和写文件: 例子r: 下一行命令: 打印: 例子: 只想输出匹配的行: 退出命令: 前面的运行效率更高 ...

  4. 重新点亮linux 命令树————网络故障排除[十一五]

    前言 简单整理一下网络故障不可达命令. 正文 ping 是否能ping traceroute 追踪路由跳转 mtr 检查数据包是否丢失 nslookup telnet 端口是否可达 tcpdump 能 ...

  5. spring cloud 学习笔记 基础工程的构建(一)

    前言 学习一下spring cloud,只是过一遍微服务的一些现代化工具,微服务其实一直都存在,去公司的时候发现一个问题,即使有些项目没有用到现代这些什么docker.k8s,其实也是微服务,微服务一 ...

  6. JavaScript中如何实现函数缓存?有哪些应用场景?

    一.是什么 函数缓存,就是将函数运算过的结果进行缓存 本质上就是用空间(缓存存储)换时间(计算过程) 常用于缓存数据计算结果和缓存对象 const add = (a,b) => a+b;cons ...

  7. 使用pycuda替换字符串,使用cuda替换字符串

    写一个python的cuda程序,实现字符串列表的字符串替换,把所有的123替换成xinyuuliu 以下是一个简单的 Python CUDA 代码示例,用于实现字符串列表的字符串替换.它使用了 NV ...

  8. Oracle 与当前日期有关的内容

    Oracle 与当前日期有关的内容 求当前日期是周几: 大概就是下面这种方法 to_char(date,'D') Select to_char(date,'ss') from dual取当前时间秒部分 ...

  9. 【深度学习】基于 Alluxio 数据缓存的性能优化

    作者 | 车漾(阿里云高级技术专家).顾荣(南京大学 副研究员) 导读:Alluxio 项目诞生于 UC Berkeley AMP 实验室,自开源以来经过 7 年的不断开发迭代,支撑大数据处理场景的数 ...

  10. SRE技术保障平台-盯屏中心TAC: 混合云一站式告警运维平台

    简介: SRE技术保障平台-盯屏中心TAC: 混合云一站式告警运维平台 1.目标定位 1.1背景 告警管控平台种类繁多 告警出现后未及时发现处理最终导致故障产生 专有云监控能力拉起依赖版本升级,操作复 ...