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>
相关推荐
吴声子夜歌15 分钟前
Guava——散列
java·guava
用户31268748772016 分钟前
AQS 到底怎么排队的?CLH 队列、state 与条件变量全链路拆解
java
Json____23 分钟前
springboot开发高校选课管理系统:从零构建前后端分离的全栈实践
java·spring boot·后端·毕业设计·毕设·wwwoop.com
站大爷IP26 分钟前
Python的列表推导式把我写崩了,原来圆括号和方括号不是一回事
后端
xcl092533 分钟前
民宿预约系统开发实战:从需求分析到上线部署全流程解析
java·spring boot
梦在远山后37 分钟前
Python 中字符串常用写法
人工智能·后端
geovindu37 分钟前
python:HandWriting Recognition using paddlepaddle
开发语言·后端·python·paddlepaddle
步行cgn1 小时前
为何以继承方式引入SpringBoot
java·spring boot·后端
CoderYanger1 小时前
A.每日一题:1140. 石子游戏 II
java·程序人生·算法·leetcode·游戏·职场和发展·深度优先
禾高网络1 小时前
养老系统开发:背景、架构与养老行业展望
java·大数据·人工智能·小程序·架构