You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2007/01/26 09:12:54 UTC

svn commit: r500174 - /incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java

Author: dblevins
Date: Fri Jan 26 00:12:53 2007
New Revision: 500174

URL: http://svn.apache.org/viewvc?view=rev&rev=500174
Log:
Tightened exception handling

Modified:
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java?view=diff&rev=500174&r1=500173&r2=500174
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java Fri Jan 26 00:12:53 2007
@@ -285,24 +285,28 @@
 
     public void createEjbJar(EjbJarInfo ejbJar) throws NamingException, IOException, OpenEJBException {
         AppInfo appInfo = new AppInfo();
+        appInfo.jarPath = ejbJar.jarPath;
         appInfo.ejbJars.add(ejbJar);
         createApplication(appInfo);
     }
 
     public void createEjbJar(EjbJarInfo ejbJar, ClassLoader classLoader) throws NamingException, IOException, OpenEJBException {
         AppInfo appInfo = new AppInfo();
+        appInfo.jarPath = ejbJar.jarPath;
         appInfo.ejbJars.add(ejbJar);
         createApplication(appInfo, classLoader);
     }
 
     public void createClient(ClientInfo clientInfo) throws NamingException, IOException, OpenEJBException {
         AppInfo appInfo = new AppInfo();
+        appInfo.jarPath = clientInfo.moduleId;
         appInfo.clients.add(clientInfo);
         createApplication(appInfo);
     }
 
     public void createClient(ClientInfo clientInfo, ClassLoader classLoader) throws NamingException, IOException, OpenEJBException {
         AppInfo appInfo = new AppInfo();
+        appInfo.jarPath = clientInfo.moduleId;
         appInfo.clients.add(clientInfo);
         createApplication(appInfo, classLoader);
     }
@@ -412,7 +416,7 @@
         }
     }
 
-    public void destroyApplication(String filePath) throws Exception {
+    public void destroyApplication(String filePath) throws UndeployException, NoSuchApplicationException {
         AssemblyUnit unit = assemblyUnits.get(filePath);
         if (unit == null) {
             throw new NoSuchApplicationException(filePath);
@@ -695,7 +699,7 @@
             this.appId = appId;
         }
 
-        private void destroy() throws Exception {
+        private void destroy() throws UndeployException {
             Context globalContext = containerSystem.getJNDIContext();
             UndeployException undeployException = new UndeployException("Failed undeploying application: id=" + appId);
             // Clear out naming for all components first
@@ -718,7 +722,7 @@
                         } catch (NamingException goodAndExpected) {
                         }
                     } catch (Throwable t) {
-                        undeployException.getCauses().add(new Exception("bean: " + deploymentID, t));
+                        undeployException.getCauses().add(new Exception("bean: " + deploymentID + ": " + t.getMessage(), t));
                     }
                 }
             }
@@ -729,7 +733,7 @@
                     container.undeploy(deployment);
                     deployment.setContainer(null);
                 } catch (Throwable t) {
-                    undeployException.getCauses().add(new Exception("bean: " + deploymentID, t));
+                    undeployException.getCauses().add(new Exception("bean: " + deploymentID + ": " + t.getMessage(), t));
                 } finally {
                     deployment.setDestroyed(true);
                 }
@@ -740,7 +744,7 @@
                 try {
                     globalContext.unbind("/openejb/client/" + clientId);
                 } catch (Throwable t) {
-                    undeployException.getCauses().add(new Exception("client: " + clientId, t));
+                    undeployException.getCauses().add(new Exception("client: " + clientId + ": " + t.getMessage(), t));
                 }
             }
             if (undeployException.getCauses().size() > 0) {