当前位置: 首页 > 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的引入

http://www.lryc.cn/news/394937.html

相关文章:

  • select single , select endselect
  • 后端学习(一)
  • 【活动行】参与上海两场线下活动,教育生态行业赛总决赛活动和WAIC人工智能大会活动 - 上海活动总结
  • conda 安装设置
  • 用PlantUML和语雀画UML类图
  • uniapp微信小程序电子签名
  • MetaPoint_速读
  • 数据库逆向工程工具reverse_sql
  • 四大内网穿透利器对比
  • 【LeetCode】每日一题:跳跃游戏 II
  • SpringBoot拦截器
  • uniapp中实现跳转链接到游览器(安卓-h5)
  • WPF UI 界面布局 魔术棒 文字笔记识别 技能提升 布局功能扩展与自定义 继承Panel的对象,测量与排列 系列七
  • 文件格式是.pb应该怎么查看?
  • android2024 gradle8 Processor和ksp两种编译时注解实现
  • elementui的table的@selection-change阻止事件改变
  • 空间数据采集与管理:为什么选择ArcGISPro和Python?
  • 案例精选 | 聚铭综合日志分析系统为江苏省电子口岸构建高效安全的贸易生态
  • TCP粘包
  • 数据泄露态势(2024年5月)
  • 二手闲置平台小程序的设计
  • 协程libgo的使用
  • 什么叫低频晶振?低频晶振最低频率能达到多少?低频晶振封装尺寸有哪些?
  • Splunk Enterprise 任意文件读取漏洞(CVE-2024-36991)
  • 零基础STM32单片机编程入门(九)IIC总线详解及EEPROM实战含源码视频
  • 数据库的操作
  • 常见的认证方式
  • DolphinScheduler部署安装or基础介绍(一)
  • Failed building wheel for pyaudio Running setup.py clean for pyaudio
  • 【ARMv8/v9 GIC- 700 系列 1 -- Programmers model for GIC-700】