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已经不推荐使用编译参数 source 和 target,建议替换成release 参数。

问题解决

在需要编译打包的模块的pom.xml 的build 下的plugins 标签下,增加maven-compiler-plugin的配置,禁用掉 source 和 target,增加 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>
相关推荐
wuminyu1 分钟前
OpenJDK学习笔记:Native线程如何回调Java
java·linux·c语言·jvm·c++
骑着蜗牛撵大象32710 分钟前
AgentScope 搭大脑、Spring AI 当手脚:企业智能体推理与执行分层落地
java·人工智能·spring·智能体·工具调用·agentscope·模型编排
CoderYanger11 分钟前
Java EE 进阶:15. Linux基本使用和程序部署(第二弹):部署 Web 项目到 Linux
linux·服务器·数据库·spring boot·spring·阿里云·java-ee
程序员小杰@29 分钟前
SpringBoot + SpringCloudAlibaba 日志 & 链路追踪 完整总结
java·spring boot·后端
EatFan1 小时前
2026 后端 AI 集成选型拆解:Spring AI 2.0、MCP 协议与 Agent 内嵌三条路径的决策要点
java·人工智能·spring
PFinal社区_南丞1 小时前
别再手写 Ubuntu 配置了!我用 AI 搓了个免费纯前端服务器配置生成器:ubuntu.pub
后端
天远API2 小时前
零信任架构实战:基于天远运营商近3个月欠费次数构建自动化授信调额合规网关
java·人工智能·架构·自动化
SummerJokes2 小时前
Java 集合 List 全套实验|从基础增删改查到实体类存储
java·python·list
想不到一个好的ID2 小时前
G1 垃圾回收器
后端
ZhengEnCi3 小时前
模型配置页怎么做:多模型备用链自动切换,API Key 加密存储只显示掩码
后端·llm·ai编程