Author: gdamour
Date: Sat Nov 27 02:13:41 2004
New Revision: 106703

URL: http://svn.apache.org/viewcvs?view=rev&rev=106703
Log:
A configuration can be loaded by the Kernel and not running. In such a case,
it is not possible to retrieve its configurationClassLoader attribute as it
is not a special attribute.

In some specific situations, where the parent Configuration was loaded and not 
running, a DeploymentException was raised as the configurationClassLoader
could not be retrieved.

Note that this was working until now as the attribute previously retrieved
was classLoader, which is a special attribute.

Modified:
   
geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java

Modified: 
geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java?view=diff&rev=106703&p1=geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java&r1=106702&p2=geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java&r2=106703
==============================================================================
--- 
geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
    (original)
+++ 
geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
    Sat Nov 27 02:13:41 2004
@@ -51,6 +51,7 @@
 import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
@@ -115,16 +116,20 @@
                 throw new DeploymentException("Unable to load parents", e);
             }
 
-            for (Iterator i = ancestors.iterator(); i.hasNext();) {
-                ObjectName name = (ObjectName) i.next();
-                try {
-                    // start the config to get the classloaders going,
-                    // by not specfying startRecursive none of the GBeans 
should start
-                    kernel.startGBean(name);
-                } catch (Exception e) {
-                    throw new DeploymentException(e);
+            try {
+                ObjectName currentConfig = parentName;
+                while ( State.RUNNING != State.fromInteger((Integer) 
kernel.getAttribute(currentConfig, "state")) ) {
+                    kernel.startGBean(currentConfig);
+                    URI currentParentID = (URI) 
kernel.getAttribute(currentConfig, "parentID");
+                    if ( null == currentParentID ) {
+                        break;
+                    }
+                    currentConfig = 
Configuration.getConfigurationObjectName(currentParentID);
                 }
+            } catch (Exception e) {
+                throw new DeploymentException(e);
             }
+                
             try {
                 parentCL = (ClassLoader) kernel.getAttribute(parentName, 
"configurationClassLoader");
             } catch (Exception e) {

Reply via email to