From b55a3f32b8cfce97503940af28fca9d0209bda21 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Wed, 1 Jul 2015 10:04:36 -0400 Subject: [PATCH] Add debug logging in case classpath is crazy --- .../main/java/org/elasticsearch/bootstrap/JarHell.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/main/java/org/elasticsearch/bootstrap/JarHell.java b/core/src/main/java/org/elasticsearch/bootstrap/JarHell.java index 40edc695689..fecc370f748 100644 --- a/core/src/main/java/org/elasticsearch/bootstrap/JarHell.java +++ b/core/src/main/java/org/elasticsearch/bootstrap/JarHell.java @@ -21,6 +21,8 @@ package org.elasticsearch.bootstrap; import org.elasticsearch.common.SuppressForbidden; import org.elasticsearch.common.io.PathUtils; +import org.elasticsearch.common.logging.ESLogger; +import org.elasticsearch.common.logging.Loggers; import java.io.IOException; import java.net.URL; @@ -31,6 +33,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; +import java.util.Arrays; import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; @@ -52,6 +55,12 @@ public class JarHell { if (loader instanceof URLClassLoader == false) { return; } + ESLogger logger = Loggers.getLogger(JarHell.class); + if (logger.isDebugEnabled()) { + logger.debug("java.class.path= {}" + System.getProperty("java.class.path")); + logger.debug("sun.boot.class.path= {}" + System.getProperty("sun.boot.class.path")); + logger.debug("classloader urls= {}" + Arrays.toString(((URLClassLoader)loader).getURLs())); + } checkJarHell(((URLClassLoader)loader).getURLs()); }