栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

JeecgBoot 升级springboot版本到2.6.0

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

JeecgBoot 升级springboot版本到2.6.0

1. 环境描述

Jeecgboot 3.0,他所依赖的springboot版本为2.3.5Release,将springboot版本升级为2.6.0。过程全纪录,从2开始描述。

2. 修改springboot版本号

 	
	    org.springframework.boot
	    spring-boot-starter-parent
	    2.6.0
	    
	

修改后,自动导入,导入完成后,运行后端,提示的错误信息有。

3. JeecgRedisCacheWriter错误

 根据提示,重新复写3个方法,用默认的。

  @Override
    public CacheStatistics getCacheStatistics(String cacheName) {
        return null;
    }
    @Override
    public void clearStatistics(String name) {

    }

    @Override
    public RedisCacheWriter withStatisticsCollector(CacheStatisticsCollector cacheStatisticsCollector) {
        return null;
    }

4. RedisUtil错误

@SuppressWarnings("unchecked")
	public void del(String... key) {
		if (key != null && key.length > 0) {
			if (key.length == 1) {
				redisTemplate.delete(key[0]);
			} else {
				redisTemplate.delete(CollectionUtils.arrayToList(key));
			}
		}
	}

将最后一条语句加上显示转换

redisTemplate.delete((Collection) CollectionUtils.arrayToList(key));

另外一个错误是

 通过点进去看源码,将改行代码调整为

Cursor cursor = connection.scan(ScanOptions.scanOptions().match(realKey).count(Integer.MAX_VALUE).build());

4. 重新编译运行

错误提示如下图:

在jeecg-boot-system-module模块的pom.xml文件中,增加了坐标,错误消失

   
            junit
            junit
            test
        

5. 重新编译运行

提示循环依赖

 对于这个问题,采用提示的解决方案

As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.

在application.yml文件中修改配置项

spring:
  application:
    name: jeecg-system
  profiles:
    active: @profile.name@
  main:
    allow-circular-references: true

6.重新编译运行

提示错误如下图

 

 百度这个问题,最后找到解决方案,将application-dev.yml文件中的配置修改下,修改的是深色标注的部分

 修改后的内容为

quartz:
    job-store-type: jdbc
    initialize-schema: embedded
    #定时任务启动开关,true-开  false-关
    auto-startup: true
    #启动时更新己存在的Job
    overwrite-existing-jobs: true
    properties:
      org:
        quartz:
          scheduler:
            instanceName: MyScheduler
            instanceId: AUTO
          jobStore:
            class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
            driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
            tablePrefix: QRTZ_
            isClustered: true
            misfireThreshold: 60000
            clusterCheckinInterval: 10000

7. 重新编译运行

提示错误

 

 

跟踪代码发现,是3中的 getCacheStatistics返回空所致。

在JeecgRedisCacheWriter类中增加如下代码

    private final CacheStatisticsCollector statistics = CacheStatisticsCollector.create();

  @Override
    public CacheStatistics getCacheStatistics(String cacheName) {
        return statistics.getCacheStatistics(cacheName);
    }

8. 重新编译运行

 

 

问题未解决 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/694269.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号