You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2012/01/11 08:48:56 UTC

svn commit: r1229917 - /geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java

Author: djencks
Date: Wed Jan 11 07:48:56 2012
New Revision: 1229917

URL: http://svn.apache.org/viewvc?rev=1229917&view=rev
Log:
GERONIMO-6249 check for config.ser before trying to read it

Modified:
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java?rev=1229917&r1=1229916&r2=1229917&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java Wed Jan 11 07:48:56 2012
@@ -705,24 +705,27 @@ public class DependencyManager implement
     //Activator replacement
 
     public void start(Bundle bundle) {
-        InputStream in = null;
-        try {
-            in = bundle.getEntry("META-INF/config.ser").openStream();
-            //TODO there are additional consistency checks in RepositoryConfigurationStore that we should use.
-            ConfigurationData data = ConfigurationUtil.readConfigurationData(in);
-            data.setBundleContext(bundle.getBundleContext());
-            configurationManager.loadConfiguration(data);
+        URL url = bundle.getEntry("META-INF/config.ser");
+        if (url != null) {
+            InputStream in = null;
+            try {
+                in = url.openStream();
+                //TODO there are additional consistency checks in RepositoryConfigurationStore that we should use.
+                ConfigurationData data = ConfigurationUtil.readConfigurationData(in);
+                data.setBundleContext(bundle.getBundleContext());
+                configurationManager.loadConfiguration(data);
 //            Artifact id = data.getId();
-            //            manager.startConfiguration(id);
-        } catch (Exception e) {
-            log.warn("Exception trying to load configuration bundle " + bundle, e);
+                //            manager.startConfiguration(id);
+            } catch (Exception e) {
+                log.warn("Exception trying to load configuration bundle " + bundle, e);
 //            throw e;
-        } finally {
-            if (in != null)
-                try {
-                    in.close();
-                } catch (Exception e) {
-                }
+            } finally {
+                if (in != null)
+                    try {
+                        in.close();
+                    } catch (Exception e) {
+                    }
+            }
         }
     }