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

本文涉及的产品
云原生内存数据库 Tair,内存型 2GB
云数据库 Redis 版,社区版 2GB
推荐场景:
搭建游戏排行榜
云数据库 Redis 版,经济版 1GB 1个月
简介: 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 BI
使用Java和Spring Batch实现批处理
使用Java和Spring Batch实现批处理
|
2天前
|
消息中间件 Java 测试技术
Java中的软件架构重构与升级策略
Java中的软件架构重构与升级策略
|
4天前
|
安全 Java 数据安全/隐私保护
使用Java和Spring Security实现身份验证与授权
使用Java和Spring Security实现身份验证与授权
|
4天前
|
消息中间件 负载均衡 Java
Java和Spring Cloud构建分布式系统
Java和Spring Cloud构建分布式系统
|
2天前
|
消息中间件 负载均衡 Java
使用Java和Spring Cloud构建分布式系统
使用Java和Spring Cloud构建分布式系统
|
2天前
|
IDE 前端开发 Java
Java中的Spring框架与企业级应用开发实践
Java中的Spring框架与企业级应用开发实践
|
2天前
|
安全 Java 数据安全/隐私保护
使用Java和Spring Security实现身份验证与授权
使用Java和Spring Security实现身份验证与授权
|
4天前
|
消息中间件 Java BI
使用Java和Spring Batch实现批处理
使用Java和Spring Batch实现批处理
|
4天前
|
Java UED Spring
Spring Boot中的零停机升级策略
Spring Boot中的零停机升级策略
|
6天前
|
负载均衡 Java 开发者
细解微服务架构实践:如何使用Spring Cloud进行Java微服务治理
【7月更文挑战第1天】Spring Cloud是Java微服务治理明星框架,整合Eureka(服务发现)、Ribbon(客户端负载均衡)、Hystrix(熔断器)、Zuul(API网关)和Config Server(配置中心),提供完整服务治理解决方案。通过Eureka实现服务注册与发现,Ribbon进行客户端负载均衡,Hystrix确保服务容错,Config Server集中管理配置,Zuul作为API网关简化系统复杂性。理解和使用Spring Cloud是现代Java开发者的关键技能。
18 0