From: James William Dumay Date: Fri, 13 Mar 2009 05:22:58 +0000 (+0000) Subject: MRM-1138 - Fix java.lang.NullPointerException: configuration can not be null on startup X-Git-Tag: archiva-1.2~63 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=47b437abc9a13ce91d2ea0a0c15fe463938dfc88;p=archiva.git MRM-1138 - Fix java.lang.NullPointerException: configuration can not be null on startup git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@753121 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java index af3180d13..cb00de9a8 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java +++ b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java @@ -138,9 +138,14 @@ public class DefaultArchivaConfiguration */ private boolean isConfigurationDefaulted = false; - private static final String KEY = "org.apache.maven.archiva"; + private static final String KEY = "org.apache.maven.archiva"; - public synchronized Configuration getConfiguration() + public Configuration getConfiguration() + { + return loadConfiguration(); + } + + private synchronized Configuration loadConfiguration() { if ( configuration == null ) { @@ -642,13 +647,13 @@ public class DefaultArchivaConfiguration expressionEvaluator.addExpressionSource( new SystemPropertyExpressionSource() ); userConfigFilename = expressionEvaluator.expand( userConfigFilename ); altConfigFilename = expressionEvaluator.expand( altConfigFilename ); + loadConfiguration(); } catch ( EvaluatorException e ) { throw new InitializationException( "Unable to evaluate expressions found in " + "userConfigFilename or altConfigFilename." ); } - registry.addChangeListener( this ); }