From 6387a5a946f70e00f7c7deb25c25c4b43d4d80ed Mon Sep 17 00:00:00 2001 From: kenzheng Date: Wed, 16 Nov 2022 23:26:25 +0800 Subject: [PATCH] fix BUG #1400,fix multiple SLF4J bindings & no log logged in standalone,yarn-session,yarn-prejob (cherry picked from commit eefae730296acd1f53ff36fe783e3b6880738377) --- bin/submit.sh | 4 +- chunjun-assembly/pom.xml | 37 ++++++++++++++++++- .../src/main/assembly/assembly.xml | 6 ++- chunjun-clients/pom.xml | 11 ++++++ .../chunjun-connector-hdfs/pom.xml | 8 +++- .../chunjun-connector-hive/pom.xml | 11 ++++++ chunjun-core/pom.xml | 8 ++-- chunjun-ddl/chunjun-ddl-mysql/pom.xml | 8 +++- chunjun-restore/chunjun-restore-mysql/pom.xml | 8 +++- 9 files changed, 87 insertions(+), 14 deletions(-) diff --git a/bin/submit.sh b/bin/submit.sh index db1de0fa6a..e96d218b3d 100644 --- a/bin/submit.sh +++ b/bin/submit.sh @@ -46,9 +46,9 @@ fi # 1.In yarn-session case, JAR_DIR can not be found # 2.In other cases, JAR_DIR can be found if [ $CHUNJUN_DEPLOY_MODE -eq 1 ]; then - JAR_DIR=$CHUNJUN_HOME/lib/* + JAR_DIR=$CHUNJUN_HOME/lib/chunjun-clients.jar:$CHUNJUN_HOME/lib/* else - JAR_DIR=$CHUNJUN_HOME/../lib/* + JAR_DIR=$CHUNJUN_HOME/../lib/chunjun-clients.jar:$CHUNJUN_HOME/../lib/* fi CLASS_NAME=com.dtstack.chunjun.client.Launcher diff --git a/chunjun-assembly/pom.xml b/chunjun-assembly/pom.xml index d353c3b7d8..08bac891f1 100644 --- a/chunjun-assembly/pom.xml +++ b/chunjun-assembly/pom.xml @@ -33,15 +33,50 @@ pom ChunJun : Assembly - true + + 2.16.0 ${project.parent.basedir} assembly none package + + + + org.apache.logging.log4j + log4j-1.2-api + ${log4j2.version} + provided + + + org.apache.logging.log4j + log4j-api + ${log4j2.version} + provided + + + org.apache.logging.log4j + log4j-core + ${log4j2.version} + provided + + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j2.version} + provided + + + slf4j-api + org.slf4j + + + + + diff --git a/chunjun-assembly/src/main/assembly/assembly.xml b/chunjun-assembly/src/main/assembly/assembly.xml index bcdf61912c..686a610651 100644 --- a/chunjun-assembly/src/main/assembly/assembly.xml +++ b/chunjun-assembly/src/main/assembly/assembly.xml @@ -59,8 +59,12 @@ lib true false - package + provided false + + + org.apache.logging.log4j:* + diff --git a/chunjun-clients/pom.xml b/chunjun-clients/pom.xml index 69b3dabb3e..673d450347 100644 --- a/chunjun-clients/pom.xml +++ b/chunjun-clients/pom.xml @@ -233,6 +233,17 @@ shade + + + + org.slf4j:* + org.apache.logging.log4j:* + ch.qos.logback:* + ch.qos.reload4j:* + commons-logging:* + log4j:log4j + + false diff --git a/chunjun-connectors/chunjun-connector-hdfs/pom.xml b/chunjun-connectors/chunjun-connector-hdfs/pom.xml index 9faa33edac..56be739072 100644 --- a/chunjun-connectors/chunjun-connector-hdfs/pom.xml +++ b/chunjun-connectors/chunjun-connector-hdfs/pom.xml @@ -228,10 +228,14 @@ + - org.slf4j:slf4j-api - log4j:log4j + org.slf4j:* + org.apache.logging.log4j:* ch.qos.logback:* + ch.qos.reload4j:* + commons-logging:* + log4j:log4j diff --git a/chunjun-connectors/chunjun-connector-hive/pom.xml b/chunjun-connectors/chunjun-connector-hive/pom.xml index 0e32951296..4e12b5a701 100644 --- a/chunjun-connectors/chunjun-connector-hive/pom.xml +++ b/chunjun-connectors/chunjun-connector-hive/pom.xml @@ -285,6 +285,17 @@ false + + + + org.slf4j:* + org.apache.logging.log4j:* + ch.qos.logback:* + ch.qos.reload4j:* + commons-logging:* + log4j:log4j + + *:* diff --git a/chunjun-core/pom.xml b/chunjun-core/pom.xml index 4a08791f81..bcac974053 100644 --- a/chunjun-core/pom.xml +++ b/chunjun-core/pom.xml @@ -451,10 +451,10 @@ + + org.slf4j:slf4j-api com.google.guava:* com.google.code.gson:* - ch.qos.logback:* - org.slf4j:* org.apache.httpcomponents:* io.prometheus:* org.apache.avro:* @@ -508,10 +508,10 @@ + + org.slf4j:slf4j-api com.google.guava:* com.google.code.gson:* - ch.qos.logback:* - org.slf4j:* org.apache.httpcomponents:* io.prometheus:* org.apache.avro:* diff --git a/chunjun-ddl/chunjun-ddl-mysql/pom.xml b/chunjun-ddl/chunjun-ddl-mysql/pom.xml index f2ec84cb3e..3e7f1026b1 100644 --- a/chunjun-ddl/chunjun-ddl-mysql/pom.xml +++ b/chunjun-ddl/chunjun-ddl-mysql/pom.xml @@ -184,9 +184,13 @@ - org.slf4j:slf4j-api - log4j:log4j + + org.slf4j:* + org.apache.logging.log4j:* ch.qos.logback:* + ch.qos.reload4j:* + commons-logging:* + log4j:log4j diff --git a/chunjun-restore/chunjun-restore-mysql/pom.xml b/chunjun-restore/chunjun-restore-mysql/pom.xml index 6f3326c60d..b6efd31fc9 100644 --- a/chunjun-restore/chunjun-restore-mysql/pom.xml +++ b/chunjun-restore/chunjun-restore-mysql/pom.xml @@ -83,9 +83,13 @@ - org.slf4j:slf4j-api - log4j:log4j + + org.slf4j:* + org.apache.logging.log4j:* ch.qos.logback:* + ch.qos.reload4j:* + commons-logging:* + log4j:log4j