From b07cd81b231e6665a6aaef71720968e130aeb0ca Mon Sep 17 00:00:00 2001 From: itsankit-google Date: Tue, 23 Jul 2024 12:27:59 +0000 Subject: [PATCH] removing log4j classes from application jar due to conflict with dataproc 2.2 --- .../io/cdap/cdap/common/twill/HadoopClassExcluder.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cdap-common/src/main/java/io/cdap/cdap/common/twill/HadoopClassExcluder.java b/cdap-common/src/main/java/io/cdap/cdap/common/twill/HadoopClassExcluder.java index a9d9ca1620c9..d6fc8fe37aea 100644 --- a/cdap-common/src/main/java/io/cdap/cdap/common/twill/HadoopClassExcluder.java +++ b/cdap-common/src/main/java/io/cdap/cdap/common/twill/HadoopClassExcluder.java @@ -39,6 +39,14 @@ public boolean accept(String className, URL classUrl, URL classPathUrl) { return false; } } + + // We don't use the log4j-api library from org.apache.logging. + // However, when ran in distributed mode which contains it, + // causes conflicts with it if we include it. + if (className.startsWith("org.apache.logging.log4j")) { + return false; + } + // We don't use the snappy library from org.iq80. We use the one from org.xerial.snappy. // This is an optional dependency from org.iq80.leveldb, hence it is not included in CDAP // However, the hive-exec contains it, which can mess up other dependency if we include it.