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>
相关推荐
舒一笑1 小时前
PandaCoder:致敬MyBatis Log Plugin,但我们做得更极致!
后端·程序员·intellij idea
毕设源码-赖学姐2 小时前
【开题答辩全过程】以 基于Android的校园快递互助APP为例,包含答辩的问题和答案
java·eclipse
damo012 小时前
stripe 支付对接
java·stripe
麦麦鸡腿堡3 小时前
Java的单例设计模式-饿汉式
java·开发语言·设计模式
简单点了3 小时前
go前后端项目的启动 、打包和部署
开发语言·后端·golang
假客套3 小时前
Request method ‘POST‘ not supported,问题分析和解决
java
傻童:CPU3 小时前
C语言需要掌握的基础知识点之前缀和
java·c语言·算法
爱吃山竹的大肚肚3 小时前
@Valid校验 -(Spring 默认不支持直接校验 List<@Valid Entity>,需用包装类或手动校验。)
java·开发语言
雨夜之寂4 小时前
mcp java实战 第一章-第一节-MCP协议简介.md
java·后端
摇滚侠4 小时前
Spring Boot 3零基础教程,WEB 开发 Thymeleaf 核心语法 笔记39
spring boot·笔记·后端·thymeleaf