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

Springboot Redisson Xxljob(Druid MySQL MybatisPlus) 对接使用

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

Springboot Redisson Xxljob(Druid MySQL MybatisPlus) 对接使用

前情提要

根据xxl-job提供的springboot的基本对接代码,Github:spingboot对接代码地址根据业务需求,框架中需要接入druid/mysql/redis/redisson等组件和框架在springboot+xxljob对接druid+mysql+mybatis-plus的测试中,启动正常在springboot+xxljob+druid+mysql+mybatis-plus对接redis+redisson的测试中,出现异常,启动失败以下进行错误排查(redis+redisson集成代码这块并无异常,去除xxljob后可正常使用)。目前考虑兼容性问题,组件版本?依赖冲突? 一、版本内容如下

    xxl-job-core-2.0.2springboot-2.6.1spring-boot-starter-data-redis-2.6.1redisson-spring-boot-starter-3.16.7druid-spring-boot-starter-1.2.8mybatis-plus-boot-starter-3.5.1mysql-connector-java-8.0.26tomcat-jdbc-8.5.23
二、配置启动

发现底层netty版本均为4.1.70.Final,但存在冲突,具体原因不明确

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00000001143564d4, pid=21642, tid=0x0000000000000e03
#
# JRE version: Java(TM) SE Runtime Environment (8.0_181-b13) (build 1.8.0_181-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.181-b13 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  [libnetty_resolver_dns_native_macos_x86_648047274197466035758.dylib+0x64d4]  netty_jni_util_JNI_OnUnload+0x84
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/chenzy/files/gitFile/xxl-job/hs_err_pid21642.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

三、解决方式

定位是netty可能存在的冲突问题(主要是redisson底层的netty与xxljob使用的netty通信存在冲突)

在xxl-job中提出netty依赖(xxl-job添加了netty-all的依赖,实际上并没有用到全部)

 
        
            com.xuxueli
            xxl-job-core
            ${xxljob.version}
            
                
                    io.netty
                    netty-all
                
            
        

启动后,针对NoClassFound的依赖,进行补充

        
            io.netty
            netty-codec-http
            4.1.70.Final
        

再次启动,相关依赖无缺失,能够正常调度任务、传递参数、调用组件 附录

springboot+xxljob+redis+redisson样例(版本如【一、版本内容如下】所描述)springboot+xxljob+redis+redisson+druid+mysql+mybatis-plus样例(版本如【一、版本内容如下】所描述)

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

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

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