Jenkins发版时报错Failed to instantiate [io.seata.spring.annotation.GlobalTransactionScanner]

Failed to instantiate [io.seata.spring.annotation.GlobalTransactionScanner]: Factory method 'globalTransactionScanner' threw exception; nested exception is java.lang.ExceptionInInitializerError

一开始以为是seata配置有问题,但最近也没有动过,直接执行发版脚本就没事,用Jenkins发版就报错。

请教了公司里的大佬,用history命令发现服务器最近有人安装了jdk17(原本一直使用8)

导致Jenkins发版的时候找不到Java环境变量

 最后大佬写了个指定环境的脚本,每个发版脚本第一行都先执行一下

#! /bin/bash
export JAVA_HOME=/opt/develop/java/jdk1.8
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

路径换成你自己服务器的即可,问题解决,记录一下。

posted @ 2024-05-08 09:32  荒野猛兽  阅读(36)  评论(0编辑  收藏  举报