ruoyi-nbcio从spring2.7.18升级springboot到3.1.7,java从java8升级到17(二)

本文涉及的产品
云数据库 Redis 版,社区版 2GB
推荐场景:
搭建游戏排行榜
简介: ruoyi-nbcio从spring2.7.18升级springboot到3.1.7,java从java8升级到17(二)

更多ruoyi-nbcio功能请看演示系统

gitee源代码地址

前后端代码: https://gitee.com/nbacheng/ruoyi-nbcio

演示地址: http://218.75.87.38:9666

更多nbcio-boot功能请看演示系统

gitee源代码地址

后端代码: https://gitee.com/nbacheng/nbcio-boot

前端代码:https://gitee.com/nbacheng/nbcio-vue.git

在线演示(包括H5) : http://218.75.87.38:9888

继续上一部分内容

7、修改完redis配置后出现下面错误

Description:
Failed to bind properties under 'spring.data.redis.ssl' to org.springframework.boot.autoconfigure.data.redis.RedisProperties$Ssl:
    Reason: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.Boolean] to type [org.springframework.boot.autoconfigure.data.redis.RedisProperties$Ssl]
Action:
Update your application's configuration

去掉ssl,如下:

--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
spring:
  data:
    redis:
     # 地址
     host: 192.168.199.151
     # 端口,默认为6379
     port: 6379
     # 数据库索引
     database: 1
     # 密码(如没有密码请注释掉)
     password: masterredis
     # 连接超时时间
     timeout: 10s
     # 是否开启ssl
     #ssl: false

8、又出现新的错误

Description:
Field factory in com.ruoyi.web.controller.system.ThirdLoginController required a bean of type 'com.xkcoding.justauth.AuthRequestFactory' that could not be found.
The injection point has the following annotations:
  - @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.xkcoding.justauth.AuthRequestFactory' in your configuration.

这部分修改如下:

private final JustAuthProperties properties = new JustAuthProperties();
    private final AuthStateCache authStateCache = null;
  private final AuthRequestFactory factory = new AuthRequestFactory(properties, authStateCache);

9、后来出现flowable的问题,这个需要升级到7以后得版本,我现在升级到最新的flowable7.01

需要修改里面的一个文件CustomProcessDiagramCanvas注释掉

try {
            USERTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/userTask.png", this.customClassLoader));
            SCRIPTTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/scriptTask.png", this.customClassLoader));
            SERVICETASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/serviceTask.png", this.customClassLoader));
            RECEIVETASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/receiveTask.png", this.customClassLoader));
            SENDTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/sendTask.png", this.customClassLoader));
            MANUALTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/manualTask.png", this.customClassLoader));
            BUSINESS_RULE_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/businessRuleTask.png", this.customClassLoader));
            SHELL_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/shellTask.png", this.customClassLoader));
            DMN_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/dmnTask.png", this.customClassLoader));
            CAMEL_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/camelTask.png", this.customClassLoader));
            //MULE_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/muleTask.png", this.customClassLoader));//flowable7后没有了
            HTTP_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/httpTask.png", this.customClassLoader));
            TIMER_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/timer.png", this.customClassLoader));
            COMPENSATE_THROW_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/compensate-throw.png", this.customClassLoader));
            COMPENSATE_CATCH_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/compensate.png", this.customClassLoader));
            ERROR_THROW_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/error-throw.png", this.customClassLoader));
            ERROR_CATCH_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/error.png", this.customClassLoader));
            MESSAGE_THROW_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/message-throw.png", this.customClassLoader));
            MESSAGE_CATCH_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/message.png", this.customClassLoader));
            SIGNAL_THROW_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/signal-throw.png", this.customClassLoader));
            SIGNAL_CATCH_IMAGE = ImageIO.read(ReflectUtil.getResource("org/flowable/icons/signal.png", this.customClassLoader));
        } catch (IOException var4) {
            LOGGER.warn("Could not load image for process diagram creation: {}", var4.getMessage());
        }

10、又出现下面问题

Parameter 1 of method openApiBuilder in com.ruoyi.framework.config.SwaggerConfig required a bean of type 'org.springdoc.core.SecurityService' that could not be found.
Action:
Consider defining a bean of type 'org.springdoc.core.SecurityService' in your configuration.

先暂时注释掉下面的代码

/**
     * 自定义 openapi 处理器
     */
   /* @Bean
    public OpenAPIService openApiBuilder(Optional<OpenAPI> openAPI,
                                         SecurityService securityParser,
                                         SpringDocConfigProperties springDocConfigProperties, PropertyResolverUtils propertyResolverUtils,
                                         Optional<List<OpenApiBuilderCustomizer>> openApiBuilderCustomisers,
                                         Optional<List<ServerBaseUrlCustomizer>> serverBaseUrlCustomisers, Optional<JavadocProvider> javadocProvider) {
        return new OpenApiHandler(openAPI, securityParser, springDocConfigProperties, propertyResolverUtils, openApiBuilderCustomisers, serverBaseUrlCustomisers, javadocProvider);
    }*/

11、前端一访问首页就报错了

- [PLUS]开始请求 => URL[GET /getInfo],无参数
[31m2024-02-24 16:05:50[0;39m [32m[XNIO-1 task-3][0;39m [1;31mERROR[0;39m [1;35mc.r.f.w.e.GlobalExceptionHandler
[0;39m - 请求地址'/getInfo',发生未知异常.
cn.dev33.satoken.exception.InvalidContextException: 未能获取有效的上下文处理器
  at cn.dev33.satoken.context.SaTokenContextDefaultImpl.getStorage(SaTokenContextDefaultImpl.java:59)
  at cn.dev33.satoken.context.SaHolder.getStorage(SaHolder.java:69)
  at com.ruoyi.common.helper.LoginHelper.getLoginUser(LoginHelper.java:69)
  at com.ruoyi.web.controller.system.SysLoginController.getInfo(SysLoginController.java:124)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.base/java.lang.reflect.Method.invoke(Method.java:568)
  at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
  at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:751)

12、下面这个要修改成boot3

<!-- Sa-Token 权限认证, 在线文档:http://sa-token.dev33.cn/ -->
            <dependency>
                <groupId>cn.dev33</groupId>
                <artifactId>sa-token-spring-boot3-starter</artifactId>
                <version>${satoken.version}</version>
            </dependency>

13、这样总算出来登录界面了


相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore &nbsp; &nbsp; ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库&nbsp;ECS 实例和一台目标数据库&nbsp;RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&amp;RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
相关文章
|
2天前
|
前端开发 安全 Java
家政系统(用户端)介绍Java18+前端html+后端springboot
家政系统(用户端)介绍Java18+前端html+后端springboot
11 0
|
2天前
|
JavaScript Java 测试技术
基于springboot+vue.js+uniapp小程序的java语言的考试信息报名系统附带文章源码部署视频讲解等
基于springboot+vue.js+uniapp小程序的java语言的考试信息报名系统附带文章源码部署视频讲解等
9 0
|
8天前
|
Java 程序员 Maven
Spring(Spring/Springboot 的创建) 基础
Spring(Spring/Springboot 的创建) 基础
|
9天前
|
JavaScript Java 测试技术
基于springboot+vue.js的基于java的教学辅助平台附带文章和源代码设计说明文档ppt
基于springboot+vue.js的基于java的教学辅助平台附带文章和源代码设计说明文档ppt
30 10
|
9天前
|
JavaScript Java 关系型数据库
springboot+vue点餐平台网站(java源码+文档)
一款基于SpringBoot的点餐平台网站项目,源码及部署详情可直接联系作者。项目采用Java、SpringBoot、Mybatis、Vue等技术,支持JDK1.8和MySQL 5.7+。系统包含管理员和用户模块,如用户管理、菜品分类与信息管理、订单管理和评价管理等功能。同时,用户可进行菜品评价和订单查询。项目适用于JavaWeb、SSH、SSM等框架的学习与实践。
|
9天前
|
JavaScript Java 测试技术
基于java的餐厅点餐系统微信小程序+springboot+vue.js附带文章和源代码设计说明文档ppt
基于java的餐厅点餐系统微信小程序+springboot+vue.js附带文章和源代码设计说明文档ppt
21 0
|
10天前
|
安全 算法 Java
Java多线程基础-15:Java 中 synchronized 的优化操作 -- 锁升级、锁消除、锁粗化
`synchronized`在Java并发编程中具有以下特性:开始时是乐观锁,竞争激烈时转为悲观锁;从轻量级锁升级至重量级锁;常使用自旋锁策略;是不公平且可重入的;不支持读写锁。
23 0
|
10天前
|
供应链 安全 Java
如何挑选一个合适的HIS系统? 基于B/S架构,JAVA语言,springboot最新技术栈开发的整套云HIS系统源码 HIS源码
最近有很多人在询问,有没有最优秀的HIS系统?在这里小编是没办法回答的。为什么呢?
33 0
如何挑选一个合适的HIS系统? 基于B/S架构,JAVA语言,springboot最新技术栈开发的整套云HIS系统源码 HIS源码
|
10天前
|
存储 Java 对象存储
<Java EE 进阶> 3.Spring简单的读和取
<Java EE 进阶> 3.Spring简单的读和取
25 1
|
10天前
|
存储 Java Maven
<Java EE 进阶> 2.Spring 创建和使用
<Java EE 进阶> 2.Spring 创建和使用
17 0