当前位置: 首页 > news >正文

Spring Cloud Gateway报sun.misc.Unsafe.park(Native Method)

项目引入spring cloud gateway的jar报,启动的时候报:

[2024-07-05 10:10:16.162][main][ERROR][org.springframework.boot.web.embedded.tomcat.TomcatStarter][61]:Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'gatewayControllerEndpoint' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration$GatewayActuatorConfiguration.class]: Unsatisfied dependency expressed through method 'gatewayControllerEndpoint' parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'modifyRequestBodyGatewayFilterFactory' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration.class]: Unsatisfied dependency expressed through method 'modifyRequestBodyGatewayFilterFactory' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.http.codec.ServerCodecConfigurer' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
[2024-07-05 10:10:16.188][main][INFO][org.apache.juli.logging.DirectJDKLog][173]:Stopping service [Tomcat]
[2024-07-05 10:10:16.193][main][WARN][org.apache.juli.logging.DirectJDKLog][173]:The web application [ROOT] appears to have started a thread named [spring.cloud.inetutils] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:sun.misc.Unsafe.park(Native Method)java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)java.lang.Thread.run(Thread.java:748)
[2024-07-05 10:10:16.196][main][WARN][org.springframework.context.support.AbstractApplicationContext][557]:Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
[2024-07-05 10:10:16.213][main][INFO][org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener][136]:Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
[2024-07-05 10:10:16.434][main][ERROR][org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter][40]:***************************
APPLICATION FAILED TO START
***************************Description:Parameter 0 of method modifyRequestBodyGatewayFilterFactory in org.springframework.cloud.gateway.config.GatewayAutoConfiguration required a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' that could not be found.Action:Consider defining a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' in your configuration.

解决方案:

网关异常报Consider defining a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' in your configuration,
是因为项目引入了spring-boot-starter-web,因为会与spring cloud gateway的webflux冲突。所以项目不要引入spring-boot-starter-web。

本案例是删除spring-boot-starter-web的引入

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 3款自己电脑就可以运行AI LLM的项目
  • AWS无服务器 应用程序开发—第十七章 Application Composer
  • 初识STM32:芯片基本信息
  • 需求分析分类和层级、分析步骤
  • 商品分类左右联动
  • 平凯星辰黄东旭出席 2024 全球数字经济大会 · 开放原子开源数据库生态论坛
  • 安卓逆向经典案例——XX优品(uniapp)
  • 医院门诊预约挂号小程序模板源码
  • 前端JS特效第30波:jquery图片列表按顺序分类排列图片组效果
  • 【MySQL】MySQL连接池原理与简易网站数据流动是如何进行
  • 【计算机组成原理 | 第二篇】计算机硬件架构的发展
  • 【机器学习】基于线性回归的医疗费用预测模型
  • 硬件开发工具Arduino IDE
  • 关于.NETCORE站点程序部署到nginx上无法访问静态文件和无法正确生成文件的问题解决过程。
  • 【Linux】内核文件系统系统调用流程摸索
  • 《Javascript数据结构和算法》笔记-「字典和散列表」
  • 0x05 Python数据分析,Anaconda八斩刀
  • 30天自制操作系统-2
  • Angularjs之国际化
  • iOS 系统授权开发
  • Linux编程学习笔记 | Linux多线程学习[2] - 线程的同步
  • macOS 中 shell 创建文件夹及文件并 VS Code 打开
  • Redash本地开发环境搭建
  • SegmentFault 社区上线小程序开发频道,助力小程序开发者生态
  • 翻译:Hystrix - How To Use
  • 极限编程 (Extreme Programming) - 发布计划 (Release Planning)
  • 前端js -- this指向总结。
  • 全栈开发——Linux
  • ​iOS安全加固方法及实现
  • #define与typedef区别
  • #LLM入门|Prompt#1.7_文本拓展_Expanding
  • #数学建模# 线性规划问题的Matlab求解
  • (2024,Flag-DiT,文本引导的多模态生成,SR,统一的标记化,RoPE、RMSNorm 和流匹配)Lumina-T2X
  • (Java数据结构)ArrayList
  • (webRTC、RecordRTC):navigator.mediaDevices undefined
  • (ZT)北大教授朱青生给学生的一封信:大学,更是一个科学的保证
  • (附源码)spring boot基于小程序酒店疫情系统 毕业设计 091931
  • (简单有案例)前端实现主题切换、动态换肤的两种简单方式
  • (原)本想说脏话,奈何已放下
  • (转)JAVA中的堆栈
  • .bat批处理(四):路径相关%cd%和%~dp0的区别
  • .desktop 桌面快捷_Linux桌面环境那么多,这几款优秀的任你选
  • .equal()和==的区别 怎样判断字符串为空问题: Illegal invoke-super to void nio.file.AccessDeniedException
  • .net core 6 redis操作类
  • .Net 基于MiniExcel的导入功能接口示例
  • .net访问oracle数据库性能问题
  • .net生成的类,跨工程调用显示注释
  • .vollhavhelp-V-XXXXXXXX勒索病毒的最新威胁:如何恢复您的数据?
  • @Repository 注解
  • @SentinelResource详解
  • @取消转义
  • [ 常用工具篇 ] AntSword 蚁剑安装及使用详解
  • [14]内置对象
  • [4.9福建四校联考]
  • [Android 数据通信] android cmwap接入点