geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r209983 - in /geronimo/trunk/modules: deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/ deploy-tool/src/java/org/apache/geronimo/deployment/cli/ deployment/src/java/org/apache/geronimo/deployment/
Date Sun, 10 Jul 2005 03:01:12 GMT
Author: ammulder
Date: Sat Jul  9 20:01:11 2005
New Revision: 209983

URL: http://svn.apache.org/viewcvs?rev=209983&view=rev
Log:
More useful deployer output in case of error
Cut down on exceptions causing client-side class loader errors

Modified:
    geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
    geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDeploy.java
    geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
    geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java

Modified: geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java?rev=209983&r1=209982&r2=209983&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
(original)
+++ geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
Sat Jul  9 20:01:11 2005
@@ -33,9 +33,9 @@
 import javax.enterprise.deploy.spi.status.ProgressEvent;
 import javax.enterprise.deploy.spi.status.ProgressListener;
 import javax.enterprise.deploy.spi.status.ProgressObject;
-import javax.management.MBeanException;
 
 import org.apache.geronimo.deployment.plugin.jmx.JMXDeploymentManager.CommandContext;
+import org.apache.geronimo.kernel.InternalKernelException;
 
 /**
  * @version $Rev$ $Date$
@@ -114,9 +114,8 @@
     }
 
     protected void doFail(Exception e) {
-        // todo dain: kernel does not throw any JMX exceptions anymore... do we still need
this
-        if (e instanceof MBeanException) {
-            e = ((MBeanException) e).getTargetException();
+        if (e instanceof InternalKernelException) {
+            e = (Exception)((InternalKernelException)e).getCause();
         }
 
         if (commandContext.isLogErrors()) {

Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDeploy.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDeploy.java?rev=209983&r1=209982&r2=209983&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDeploy.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDeploy.java
Sat Jul  9 20:01:11 2005
@@ -50,9 +50,12 @@
         return "Deployed";
     }
 
-    protected ProgressObject runCommand(DeploymentManager mgr, PrintWriter out, Target[]
tlist, File module, File plan) {
+    protected ProgressObject runCommand(DeploymentManager mgr, PrintWriter out, Target[]
tlist, File module, File plan) throws DeploymentException {
         ProgressObject po = mgr.distribute(tlist, module, plan);
         waitForProgress(out, po);
+        if(po.getDeploymentStatus().isFailed()) {
+            throw new DeploymentException("Unable to distribute "+(module == null ? plan.getName()
: module.getName())+": "+po.getDeploymentStatus().getMessage());
+        }
         return mgr.start(po.getResultTargetModuleIDs());
     }
 

Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java?rev=209983&r1=209982&r2=209983&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
Sat Jul  9 20:01:11 2005
@@ -56,7 +56,7 @@
         super(command, group, helpArgumentList, helpText);
     }
 
-    protected ProgressObject runCommand(DeploymentManager mgr, PrintWriter out, Target[]
tlist, File module, File plan) {
+    protected ProgressObject runCommand(DeploymentManager mgr, PrintWriter out, Target[]
tlist, File module, File plan) throws DeploymentException {
         return mgr.distribute(tlist, module, plan);
     }
 

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java?rev=209983&r1=209982&r2=209983&view=diff
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
(original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
Sat Jul  9 20:01:11 2005
@@ -79,11 +79,21 @@
             return deploy(planFile, moduleFile, null, true, null, null, null);
         } catch (DeploymentException e) {
             log.debug("Deployment failed: plan=" + planFile +", module=" + originalModuleFile,
e);
-            throw e;
+            throw cleanseDeploymentException(e);
         } finally {
             if (tmpDir != null) {
                 DeploymentUtil.recursiveDelete(tmpDir);
             }
+        }
+    }
+
+    private DeploymentException cleanseDeploymentException(DeploymentException source) {
+        if(source.getCause() != null) {
+            Throwable e = source.getCause();
+            DeploymentException newx = new DeploymentException(source.getMessage()+" caused
by "+e.getMessage(), null);
+            return newx;
+        } else {
+            return source;
         }
     }
 



Mime
View raw message