From 771fd54391fcdfec861c4cfee1483228a9ffcc26 Mon Sep 17 00:00:00 2001 From: lixinyang <84127069+Nicklee007@users.noreply.github.com> Date: Tue, 21 Jun 2022 19:37:39 +0800 Subject: [PATCH] [fix][broker] fix DEFAULT_NAR_EXTRACTION_DIR cause NoClassDefFoundError (#15979) --- .../main/java/org/apache/pulsar/common/nar/NarClassLoader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pulsar-common/src/main/java/org/apache/pulsar/common/nar/NarClassLoader.java b/pulsar-common/src/main/java/org/apache/pulsar/common/nar/NarClassLoader.java index 321cfe370a7b3..c4864883788d9 100644 --- a/pulsar-common/src/main/java/org/apache/pulsar/common/nar/NarClassLoader.java +++ b/pulsar-common/src/main/java/org/apache/pulsar/common/nar/NarClassLoader.java @@ -139,7 +139,8 @@ public class NarClassLoader extends URLClassLoader { private static final String TMP_DIR_PREFIX = "pulsar-nar"; - public static final String DEFAULT_NAR_EXTRACTION_DIR = System.getProperty("java.io.tmpdir"); + public static final String DEFAULT_NAR_EXTRACTION_DIR = System.getProperty("nar.extraction.tmpdir") != null + ? System.getProperty("nar.extraction.tmpdir") : System.getProperty("java.io.tmpdir"); static NarClassLoader getFromArchive(File narPath, Set additionalJars, ClassLoader parent, String narExtractionDirectory)