geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r561390 - /geronimo/server/branches/2.0/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
Date Tue, 31 Jul 2007 16:48:42 GMT
Author: dblevins
Date: Tue Jul 31 09:48:40 2007
New Revision: 561390

URL: http://svn.apache.org/viewvc?view=rev&rev=561390
Log:
Port of trunk commit r559685: Unroll validation errors/failures into the message of the deployment
exception so the client can pick them up.  This may cause the server.log to get the info twice.

Modified:
    geronimo/server/branches/2.0/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java

Modified: geronimo/server/branches/2.0/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?view=diff&rev=561390&r1=561389&r2=561390
==============================================================================
--- geronimo/server/branches/2.0/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
(original)
+++ geronimo/server/branches/2.0/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
Tue Jul 31 09:48:40 2007
@@ -87,6 +87,9 @@
 import org.apache.openejb.config.ReadDescriptors;
 import org.apache.openejb.config.UnknownModuleTypeException;
 import org.apache.openejb.config.UnsupportedModuleTypeException;
+import org.apache.openejb.config.ValidationFailedException;
+import org.apache.openejb.config.ValidationError;
+import org.apache.openejb.config.ValidationFailure;
 import org.apache.openejb.jee.EjbJar;
 import org.apache.openejb.jee.EnterpriseBean;
 import org.apache.openejb.jee.MessageDestinationRef;
@@ -510,6 +513,19 @@
             AppInfo appInfo;
             try {
                 appInfo = openEjbSystem.configureApplication(appModule);
+            } catch (ValidationFailedException set) {
+                StringBuilder sb = new StringBuilder();
+                sb.append("Jar failed validation: "+appModule.getModuleId());
+
+                for (ValidationError e : set.getErrors()) {
+                    sb.append(e.getPrefix() + " ... " + e.getComponentName() + ":\t" + e.getMessage(2));
+                }
+
+                for (ValidationFailure e : set.getFailures()) {
+                    sb.append(e.getPrefix() + " ... " + e.getComponentName() + ":\t" + e.getMessage(2));
+                }
+
+                throw new DeploymentException(sb.toString());
             } catch (OpenEJBException e) {
                 throw new DeploymentException(e);
             }



Mime
View raw message