1、复现

1.1、配置

image.png

1.2、流程实例状态

image.png

1.3、看执行日志

[INFO] 2024-07-11 09:43:34.785 +0800 - ****************************** Script Content *****************************************************************
[INFO] 2024-07-11 09:43:34.785 +0800 - #!/bin/bash
BASEDIR=$(cd `dirname $0`; pwd)
cd $BASEDIR
source /etc/profile
export HADOOP_HOME=${HADOOP_HOME:-/home/hadoop-3.3.1}
export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-/opt/soft/hadoop/etc/hadoop}
export SPARK_HOME=${SPARK_HOME:-/home/spark-3.2.1-bin-hadoop3.2}
export PYTHON_HOME=${PYTHON_HOME:-/opt/soft/python}
export HIVE_HOME=${HIVE_HOME:-/home/hive-3.1.2}
export FLINK_HOME=/home/flink-1.18.1
export DATAX_HOME=${DATAX_HOME:-/opt/soft/datax}
export SEATUNNEL_HOME=/opt/software/seatunnel
export CHUNJUN_HOME=${CHUNJUN_HOME:-/opt/soft/chunjun}

export PATH=$HADOOP_HOME/bin:$SPARK_HOME/bin:$PYTHON_HOME/bin:$JAVA_HOME/bin:$HIVE_HOME/bin:$FLINK_HOME/bin:$DATAX_HOME/bin:$SEATUNNEL_HOME/bin:$CHUNJUN_HOME/bin:$PATH
${JAVA_HOME}/bin/javac -classpath .:/tmp/dolphinscheduler/exec/process/root/13850571680800/14237629094560_5/2085/1673 /tmp/dolphinscheduler/exec/process/root/13850571680800/14237629094560_5/2085/1673/DemoTest.java;${JAVA_HOME}/bin/java -classpath .:/tmp/dolphinscheduler/exec/process/root/13850571680800/14237629094560_5/2085/1673 DemoTest  
[INFO] 2024-07-11 09:43:34.785 +0800 - ****************************** Script Content *****************************************************************
[INFO] 2024-07-11 09:43:34.785 +0800 - Executing shell command : sudo -u root -i /tmp/dolphinscheduler/exec/process/root/13850571680800/14237629094560_5/2085/1673/2085_1673.sh
[INFO] 2024-07-11 09:43:34.788 +0800 - process start, process id is: 850090
[INFO] 2024-07-11 09:43:36.789 +0800 -  -> 
    /tmp/dolphinscheduler/exec/process/root/13850571680800/14237629094560_5/2085/1673/DemoTest.java:1: error: class DemoTest123 is public, should be declared in a file named DemoTest123.java
    public class DemoTest123 {
           ^
    1 error
    Error: Could not find or load main class DemoTest
[INFO] 2024-07-11 09:43:36.790 +0800 - process has exited. execute path:/tmp/dolphinscheduler/exec/process/root/13850571680800/14237629094560_5/2085/1673, processId:850090 ,exitStatusCode:1 ,processWaitForStatus:true ,processExitValue:1

其实就是解析类名称是DemoTest,真正的类名称是DemoTest123

2、解决

修改正则表达式 :
image.png

org.apache.dolphinscheduler.plugin.task.java.JavaConstants

public static final String PUBLIC_CLASS_NAME_REGEX = "(.*\\s*public\\s+class\\s+)([a-zA-Z_]\\w*)([.\\s\\S]*)";

如感兴趣,点赞加关注,谢谢!!!


journey
32 声望20 粉丝