Spring boot 2.0 升级到 3.3.1 的相关问题 (十)

文章目录

  • [Spring boot 2.0 升级到 3.3.1 的相关问题 (十)](#Spring boot 2.0 升级到 3.3.1 的相关问题 (十))

Spring boot 2.0 升级到 3.3.1 的相关问题 (十)

Dubbo 关闭Qos 服务处理

问题描述

应用启动的时候提示Qos服务绑定默认22222端口失败,导致启动Qos服务失败。

错误日志

复制代码
Fail to start qos server: , dubbo version: 3.2.14, current host: xxx.xxx.xxx.xxx, error code: 7-4. This may be caused by , go to https://dubbo.apache.org/faq/7/4 to find instructions. org.apache.dubbo.qos.server.QosBindException: qos-server can not bind localhost:22222

问题解决

解决方案

参考官方文档https://cn.dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/qos/overview/

配置关闭Qos服务

java 复制代码
##关闭Qos 服务
dubbo.application.qos-enable=false

注意:不管是配置成dubbo.application.qos.enable 或者 dubbo.application.qosEnable 都不会生效,但看Dubbo的配置源码是支持dubbo.application.qos.enable ,目前没深入了解原因。

解决后的效果

启动后能看到下面的信息

复制代码
qos won't be started because it is disabled. Please check dubbo.application.qos.enable is configured either in system property, dubbo.properties or XML/spring-boot configuration., dubbo version: 3.2.14, current host: xxx.xxx.xxx.xxx

Maven 用Java21编译出Java8的代码并在Java 21上运行。

部分第三方的项目没有升级到到Java21,因此需要做兼容处理,兼容的方案有两个:

1、存在多个版本Java 运行环境

2、编译出Java8的目标代码,并在Java21上运行

问题描述

编译打包的实际的时候会出现警告

复制代码
[WARNING] bootstrap class path not set in conjunction with -source 8
[WARNING] source value 8 is obsolete and will be removed in a future release
[WARNING] target value 8 is obsolete and will be removed in a future release
[WARNING] To suppress warnings about obsolete options, use -Xlint:-options.

原因就是在JAVA 21已经不推荐使用编译参数 sourcetarget,建议替换成release 参数。

问题解决

在需要编译打包的模块的pom.xml 的build 下的plugins 标签下,增加maven-compiler-plugin的配置,禁用掉 sourcetarget,增加 release

xml 复制代码
<!-- Compiler -->
<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-compiler-plugin</artifactId>
	<version>${maven-compiler-plugin.version}</version>
	<configuration>
		<release>${maven.compiler.release}</release>
		<source/>
		<target/>
	</configuration>
</plugin>
相关推荐
没有bug.的程序员2 小时前
服务网格 Service Mesh:微服务通信的终极进化
java·分布式·微服务·云原生·service_mesh
uzong4 小时前
一次慢接口背后,竟藏着40+种可能!你中过几个
后端·面试·程序员
G探险者4 小时前
滴滴P0级故障背后:互联网公司是如何分级处理线上事故的?
后端
G探险者5 小时前
从 Tomcat 与 Jetty 的对比,聊聊影响一个服务并发能力的关键因素
后端
你的人类朋友5 小时前
“签名”这个概念是非对称加密独有的吗?
前端·后端·安全
南尘NCA86665 小时前
企业微信防封防投诉拦截系统:从痛点解决到技术实现
java·网络·企业微信
幼稚园的山代王5 小时前
go语言了解
开发语言·后端·golang
kkjt01305 小时前
{MySQL查询性能优化索引失效的八大场景与深度解决方案}
后端
怪兽20146 小时前
SQL优化手段有哪些
java·数据库·面试