]> source.dussan.org Git - archiva.git/commitdiff
MRM-1138 - Fix java.lang.NullPointerException: configuration can not be null on startup
authorJames William Dumay <jdumay@apache.org>
Fri, 13 Mar 2009 05:22:58 +0000 (05:22 +0000)
committerJames William Dumay <jdumay@apache.org>
Fri, 13 Mar 2009 05:22:58 +0000 (05:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@753121 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java

index af3180d132811898cee194e2d0f086365f4a762c..cb00de9a88694ab60c8cbb3442da60fed5e765dc 100644 (file)
@@ -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 );
     }