geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r1025961 - in /geronimo/server/trunk: ./ plugins/bval/bval-deployer/src/main/history/ plugins/bval/geronimo-bval/src/main/java/org/apache/geronimo/bval/ plugins/j2ee/j2ee-deployer/ plugins/j2ee/j2ee-deployer/src/main/history/ plugins/openjp...
Date Thu, 21 Oct 2010 11:52:11 GMT
Author: rickmcguire
Date: Thu Oct 21 11:52:10 2010
New Revision: 1025961

URL: http://svn.apache.org/viewvc?rev=1025961&view=rev
Log:
Fix bean validation testsuite and tck failures

Modified:
    geronimo/server/trunk/plugins/bval/bval-deployer/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/bval/geronimo-bval/src/main/java/org/apache/geronimo/bval/ValidatorFactoryGBean.java
    geronimo/server/trunk/plugins/j2ee/j2ee-deployer/pom.xml
    geronimo/server/trunk/plugins/j2ee/j2ee-deployer/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/openjpa2/persistence-jpa20-deployer/src/main/history/dependencies.xml
    geronimo/server/trunk/pom.xml

Modified: geronimo/server/trunk/plugins/bval/bval-deployer/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/bval/bval-deployer/src/main/history/dependencies.xml?rev=1025961&r1=1025960&r2=1025961&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/bval/bval-deployer/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/bval/bval-deployer/src/main/history/dependencies.xml Thu
Oct 21 11:52:10 2010
@@ -26,4 +26,19 @@
         <artifactId>j2ee-deployer</artifactId>
         <type>car</type>
     </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-bval</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-bval-builder</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-validation_1.0_spec</artifactId>
+        <type>jar</type>
+    </dependency>
 </plugin-artifact>

Modified: geronimo/server/trunk/plugins/bval/geronimo-bval/src/main/java/org/apache/geronimo/bval/ValidatorFactoryGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/bval/geronimo-bval/src/main/java/org/apache/geronimo/bval/ValidatorFactoryGBean.java?rev=1025961&r1=1025960&r2=1025961&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/bval/geronimo-bval/src/main/java/org/apache/geronimo/bval/ValidatorFactoryGBean.java
(original)
+++ geronimo/server/trunk/plugins/bval/geronimo-bval/src/main/java/org/apache/geronimo/bval/ValidatorFactoryGBean.java
Thu Oct 21 11:52:10 2010
@@ -118,8 +118,8 @@ public class ValidatorFactoryGBean imple
     public ValidatorFactory getFactory() {
         if (factory == null) {
             if (validationConfig == null) {
-                // No validation configuration specified. Create default instance.
-                factory = Validation.buildDefaultValidatorFactory();
+                // just create the default 
+                createDefaultFactory(); 
             } else {
                 // Parse the validation xml
                 ValidationConfigType validationConfigType = null;
@@ -150,7 +150,9 @@ public class ValidatorFactoryGBean imple
                                 out.close();
                                 validationConfigURL = new URL("jar:"+tmpArchiveFile.toURI().toURL()+"!/"+validationConfig);
                             } catch (IOException e) {
-                                throw new ValidationException("Error processing validation
configuration "+validationConfig+" in "+moduleName, e);
+                                log.debug("Error processing validation configuration "+validationConfig+"
in "+moduleName + " Using default factory.", e);
+                                createDefaultFactory(); 
+                                return factory; 
                             }
                         }
                     }
@@ -158,7 +160,9 @@ public class ValidatorFactoryGBean imple
                     JAXBElement<ValidationConfigType> root = unmarshaller.unmarshal(stream,
ValidationConfigType.class);
                     validationConfigType = root.getValue();
                 } catch(Throwable t) {
-                    throw new ValidationException("Unable to create module ValidatorFactory
instance", t);
+                    log.debug("Unable to create module ValidatorFactory instance.  Using
default factory", t);
+                    createDefaultFactory(); 
+                    return factory; 
                 }
                 // Apply the configuration
                 // TODO: Ideally this processing should happen in BVal code. But, the ValidationParser
loads the validation xml and
@@ -168,7 +172,13 @@ public class ValidatorFactoryGBean imple
                 applyConfig(validationConfigType, config);
                 config.ignoreXmlConfiguration();
                 // Create the factory instance
-                factory = config.buildValidatorFactory();
+                ClassLoader oldContextLoader = Thread.currentThread().getContextClassLoader();

+                try {
+                    Thread.currentThread().setContextClassLoader(classLoader); 
+                    factory = config.buildValidatorFactory();
+                } finally {
+                    Thread.currentThread().setContextClassLoader(oldContextLoader); 
+                }
                 if(tmpArchiveFile != null) {
                     tmpArchiveFile.delete();
                 }
@@ -176,6 +186,20 @@ public class ValidatorFactoryGBean imple
         }
         return factory; 
     }
+    
+    /**
+     * Create a default ValidatorFactory
+     */
+    private void createDefaultFactory() {
+        ClassLoader oldContextLoader = Thread.currentThread().getContextClassLoader(); 
+        // No validation configuration specified. Create default instance.
+        try {
+            Thread.currentThread().setContextClassLoader(classLoader); 
+            factory = Validation.buildDefaultValidatorFactory();
+        } finally {
+            Thread.currentThread().setContextClassLoader(oldContextLoader); 
+        }
+    }
 
     @SuppressWarnings("unchecked")
     private void applyConfig(ValidationConfigType xmlConfig, ConfigurationImpl target) {

Modified: geronimo/server/trunk/plugins/j2ee/j2ee-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/j2ee-deployer/pom.xml?rev=1025961&r1=1025960&r2=1025961&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/j2ee-deployer/pom.xml (original)
+++ geronimo/server/trunk/plugins/j2ee/j2ee-deployer/pom.xml Thu Oct 21 11:52:10 2010
@@ -106,12 +106,6 @@
 
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-bval-builder</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-test-ddbean</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>

Modified: geronimo/server/trunk/plugins/j2ee/j2ee-deployer/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/j2ee-deployer/src/main/history/dependencies.xml?rev=1025961&r1=1025960&r2=1025961&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/j2ee-deployer/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/j2ee/j2ee-deployer/src/main/history/dependencies.xml Thu
Oct 21 11:52:10 2010
@@ -7,21 +7,6 @@
         <type>car</type>
     </module-id>
     <dependency>
-        <groupId>commons-beanutils</groupId>
-        <artifactId>commons-beanutils</artifactId>
-        <type>jar</type>
-    </dependency>
-    <dependency>
-        <groupId>commons-collections</groupId>
-        <artifactId>commons-collections</artifactId>
-        <type>jar</type>
-    </dependency>
-    <dependency>
-        <groupId>org.apache.bval</groupId>
-        <artifactId>org.apache.bval.bundle</artifactId>
-        <type>jar</type>
-    </dependency>
-    <dependency>
         <groupId>org.apache.geronimo.configs</groupId>
         <artifactId>j2ee-server</artifactId>
         <type>car</type>
@@ -43,16 +28,6 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.modules</groupId>
-        <artifactId>geronimo-bval</artifactId>
-        <type>jar</type>
-    </dependency>
-    <dependency>
-        <groupId>org.apache.geronimo.modules</groupId>
-        <artifactId>geronimo-bval-builder</artifactId>
-        <type>jar</type>
-    </dependency>
-    <dependency>
-        <groupId>org.apache.geronimo.modules</groupId>
         <artifactId>geronimo-j2ee-builder</artifactId>
         <type>jar</type>
     </dependency>
@@ -97,11 +72,6 @@
         <type>jar</type>
     </dependency>
     <dependency>
-        <groupId>org.apache.geronimo.specs</groupId>
-        <artifactId>geronimo-validation_1.0_spec</artifactId>
-        <type>jar</type>
-    </dependency>
-    <dependency>
         <groupId>org.apache.openejb</groupId>
         <artifactId>openejb-jee</artifactId>
         <type>jar</type>

Modified: geronimo/server/trunk/plugins/openjpa2/persistence-jpa20-deployer/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openjpa2/persistence-jpa20-deployer/src/main/history/dependencies.xml?rev=1025961&r1=1025960&r2=1025961&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openjpa2/persistence-jpa20-deployer/src/main/history/dependencies.xml
(original)
+++ geronimo/server/trunk/plugins/openjpa2/persistence-jpa20-deployer/src/main/history/dependencies.xml
Thu Oct 21 11:52:10 2010
@@ -7,6 +7,21 @@
         <type>car</type>
     </module-id>
     <dependency>
+        <groupId>commons-beanutils</groupId>
+        <artifactId>commons-beanutils</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>commons-collections</groupId>
+        <artifactId>commons-collections</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.bval</groupId>
+        <artifactId>org.apache.bval.bundle</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>org.apache.geronimo.configs</groupId>
         <artifactId>j2ee-deployer</artifactId>
         <type>car</type>

Modified: geronimo/server/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/pom.xml?rev=1025961&r1=1025960&r2=1025961&view=diff
==============================================================================
--- geronimo/server/trunk/pom.xml (original)
+++ geronimo/server/trunk/pom.xml Thu Oct 21 11:52:10 2010
@@ -173,7 +173,7 @@
             <dependency>
                 <groupId>org.apache.geronimo.specs</groupId>
                 <artifactId>geronimo-ejb_3.1_spec</artifactId>
-                <version>1.0.1</version>
+                <version>1.0.2-SNAPSHOT</version>
             </dependency>
 
             <dependency>



Mime
View raw message