You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jb...@apache.org on 2004/09/18 22:03:59 UTC

svn commit: rev 46301 - in geronimo/trunk/modules: deployment/src/java/org/apache/geronimo/deployment/plugin/local kernel/src/java/org/apache/geronimo/kernel

Author: jboynes
Date: Sat Sep 18 13:03:59 2004
New Revision: 46301

Modified:
   geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java
   geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java
Log:
Do not suppress InstanceNotFoundException that is raised if an attempt is made to stop an unknown GBean.
This now allows the NoSuchConfigException to be raised if an attempt is made to undeploy a configuration that is not loaded. Do not treat this as a failure on the client (after all it is not actually deployed).

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java	(original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java	Sat Sep 18 13:03:59 2004
@@ -24,6 +24,7 @@
 import javax.management.ObjectName;
 
 import org.apache.geronimo.kernel.KernelMBean;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
 import org.apache.geronimo.deployment.plugin.TargetImpl;
 import org.apache.geronimo.deployment.plugin.TargetModuleIDImpl;
 
@@ -47,12 +48,17 @@
                 TargetModuleIDImpl module = (TargetModuleIDImpl) modules[i];
 
                 URI moduleID = URI.create(module.getModuleID());
-                kernel.stopConfiguration(moduleID);
+                try {
+                    kernel.stopConfiguration(moduleID);
+
+                    TargetImpl target = (TargetImpl) module.getTarget();
+                    ObjectName storeName = target.getObjectName();
+                    URI configID = URI.create(module.getModuleID());
+                    kernel.invoke(storeName, "uninstall", new Object[]{configID}, UNINSTALL_SIG);
+                } catch (NoSuchConfigException e) {
+                    // module was already undeployed - just continue
+                }
 
-                TargetImpl target = (TargetImpl) module.getTarget();
-                ObjectName storeName = target.getObjectName();
-                URI configID = URI.create(module.getModuleID());
-                kernel.invoke(storeName, "uninstall", new Object[]{configID}, UNINSTALL_SIG);
                 addModule(module);
             }
             complete("Completed");

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java	(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java	Sat Sep 18 13:03:59 2004
@@ -278,6 +278,10 @@
     public void stopGBean(ObjectName name) throws InstanceNotFoundException, InvalidConfigException {
         try {
             invoke(name, "stop");
+        } catch (InstanceNotFoundException e) {
+            throw e;
+        } catch (InvalidConfigException e) {
+            throw e;
         } catch (Exception e) {
             throw new InvalidConfigException("Invalid GBean configuration for " + name, e);
         }