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服务

##关闭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

<!-- 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>
  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值