报错信息:

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. #轮廓线dp#洛谷 1879 [USACO06NOV]Corn Fields G

    题目 分析 考虑状压dp在\(n\leq 21\)的情况下会TLE, 设\(dp[n][m][S]\)表示当前正在处理\((n,m)\)这个格子 并且轮廓线状态为\(S\)的方案数, 考虑可行状态最多 ...

  2. #状压dp#JZOJ 3853 帮助Bsny

    题目 一共有\(n\)本书,混乱值是连续相同高度书本的段数. 可以取出\(k\)本书随意放回,问最小混乱值,高度\([25\sim 32]\) 分析 设\(f[i][j][k][mask]\)表示前\ ...

  3. 码力全开!请查收HDC.Together 2023亮点日程

    <主题演讲> <技术交流与互动> <妙趣之旅>

  4. 什么是ip协议二

    前言 续前面一章. 正文 看下ip选项: 看一张图: 这个ip选项一般我们不用看,即使你去搞硬件,那么做c++或者c的人会告诉你填啥,按照他们设置即可. 那么ip是如何传输的呢? 先看这张图,这张图的 ...

  5. 实训篇-Html-计算器

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  6. 《c#高级编程》第2章C#2.0中的更改(二)——匿名类型

    一.概念 C#中的匿名类型是一种特殊类型,可以在运行时动态创建一个对象,该对象可以包含多个属性,这些属性的名称和类型可以在创建时指定.相对于定义具体的类,匿名类型更加灵活和简洁. C#的匿名类型通常用 ...

  7. 力扣162(java&python)-寻找峰值(中等)

    题目: 峰值元素是指其值严格大于左右相邻值的元素. 给你一个整数数组 nums,找到峰值元素并返回其索引.数组可能包含多个峰值,在这种情况下,返回 任何一个峰值 所在位置即可. 你可以假设 nums[ ...

  8. Flagger on ASM——基于Mixerless Telemetry实现渐进式灰度发布系列 3 渐进式灰度发布

    简介: 作为CNCF[成员](https://landscape.cncf.io/card-mode?category=continuous-integration-delivery&grou ...

  9. Python静态类型解析工具简介和实践

    简介: Python是一门强类型的动态类型语言,开发者可以给对象动态指定类型,但类型不匹配的操作是不被允许的.动态类型帮助开发者写代码轻松愉快,然而,俗话说:动态一时爽,重构火葬场.动态类型也带来了许 ...

  10. ACMMM2021|在多模态训练中融入“知识+图谱”:方法及电商应用实践

    ​简介: 随着人工智能技术的不断发展,知识图谱作为人工智能领域的知识支柱,以其强大的知识表示和推理能力受到学术界和产业界的广泛关注.近年来,知识图谱在语义搜索.问答.知识管理等领域得到了广泛的应用. ...