报错信息:

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. #Multi-SG#HDU 5795 A Simple Nim

    题目 有\(n\)堆石子,每次可以从一堆中取出若干个或是将一堆分成三堆非空的石子, 取完最后一颗石子获胜,问先手是否必胜 分析 它的后继还包含了分成三堆非空石子的SG函数,找规律可以发现 \[SG[x ...

  2. openGauss资源池化开发者入门指南(二)

    openGauss 资源池化开发者入门指南(二) 一.内容简介 openGauss 资源池化是 openGauss 推出的一种新型的集群架构.通过 DMS 和 DSS 组件,实现集群中多个节点的底层存 ...

  3. 【直播合集】HDC.Together 2023 精彩回顾!收藏勿错过~

    HDC.Together 2023 主题演讲 万象复兴,热潮澎湃,HarmonyOS 全面进化,迈入新纪元.以创新改变世界,以生态驱动未来.扬帆起航,就在此刻.新版本.新体验.新流量.新商业.新机遇. ...

  4. 支持API 9的Sample已上新,速来拿走

    原文:https://mp.weixin.qq.com/s/sPDG5sG5F_gTp0cE1VV3gQ,点击链接查看更多技术内容.   今年的华为开发者大会上我们发布了HarmonyOS 3.1 D ...

  5. flutter3-macOS桌面端os系统|flutter3.x+window_manager仿mac桌面管理

    原创力作flutter3+getX+window_manager仿Mac桌面系统平台Flutter-MacOS. flutter3_macui基于最新跨端技术flutter3.19+dart3.3+w ...

  6. redis 简单整理——redis 准备篇[一]

    前言 简单整理一下redis. 正文 为什么使用redis? 速度快 1.1 内存执行 1.2 c语言编写,速度相对快一些 1.3 单线程,比较符合这种存储模式 2 丰富的数据结构 3 丰富的功能机制 ...

  7. docker 应用篇————nginx 例子[六]

    前言 简单整理一下nginx 例子. 正文 拉取nginx 镜像. docker pull nginx 那么会拉取nginx:latest 这个. 如果需要其他的,可以去官网查询一下. 2.docke ...

  8. 面向切面编程AOP[四](java AnnotationAwareAspectJAutoProxyCreator与ioc的联系)

    前言 拿出上一篇的内容: AnnotationAwareAspectJAutoProxyCreator extends AspectJAwareAdvisorAutoProxyCreator Aspe ...

  9. Kotlin 使用协程编写高效的并发程序

    概念: 轻量级的线程 协程允许我们在单线程模式下模拟多线程编程的效果,代码执行时的挂起与恢复完 全是由编程语言来控制的,和操作系统无关.这种特性使得高并发程序的运行效率得到了极大的提升. 依赖库: d ...

  10. 前端直接获取用户IP的方法

    前端直接获取用户IP的方法 简单来说就是使用两个接口 一个是太平洋网 <script src="//whois.pconline.com.cn/ipJson.jsp?callback= ...