Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 345AE200C54 for ; Wed, 29 Mar 2017 00:13:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 32E35160B9B; Tue, 28 Mar 2017 22:13:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7BA20160B89 for ; Wed, 29 Mar 2017 00:13:03 +0200 (CEST) Received: (qmail 42193 invoked by uid 500); 28 Mar 2017 22:13:02 -0000 Mailing-List: contact dev-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list dev@accumulo.apache.org Received: (qmail 42182 invoked by uid 99); 28 Mar 2017 22:13:02 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Mar 2017 22:13:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 55D18DFDCD; Tue, 28 Mar 2017 22:13:02 +0000 (UTC) From: mikewalch To: dev@accumulo.apache.org Reply-To: dev@accumulo.apache.org References: In-Reply-To: Subject: [GitHub] accumulo pull request #236: ACCUMULO-4614 AccumuloClassLoader should load ac... Content-Type: text/plain Message-Id: <20170328221302.55D18DFDCD@git1-us-west.apache.org> Date: Tue, 28 Mar 2017 22:13:02 +0000 (UTC) archived-at: Tue, 28 Mar 2017 22:13:04 -0000 Github user mikewalch commented on a diff in the pull request: https://github.com/apache/accumulo/pull/236#discussion_r108550201 --- Diff: start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java --- @@ -44,21 +44,21 @@ public class AccumuloClassLoader { - public static final String CLASSPATH_PROPERTY_NAME = "general.classpaths"; + public static final String GENERAL_CLASSPATHS = "general.classpaths"; public static final String MAVEN_PROJECT_BASEDIR_PROPERTY_NAME = "general.maven.project.basedir"; public static final String DEFAULT_MAVEN_PROJECT_BASEDIR_VALUE = ""; - private static String SITE_CONF; + private static URL accumuloConfigUrl; private static URLClassLoader classloader; private static final Logger log = LoggerFactory.getLogger(AccumuloClassLoader.class); static { - String configFile = System.getProperty("org.apache.accumulo.config.file", "accumulo-site.xml"); - if (System.getenv("ACCUMULO_CONF_DIR") != null) { - // accumulo conf dir should be set - SITE_CONF = System.getenv("ACCUMULO_CONF_DIR") + "/" + configFile; + String configFilename = System.getProperty("org.apache.accumulo.config.file", "accumulo-site.xml"); + accumuloConfigUrl = AccumuloClassLoader.class.getClassLoader().getResource(configFilename); + if (accumuloConfigUrl == null) { + log.warn("Failed to load Accumulo configuration '{}' from classpath", configFilename); --- End diff -- The classpath can change and accumulo-site.xml could be loaded from an unexpected location. This gives users the ability to be very explicit about where configuration will be loaded. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---