openejb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1161238 - in /openejb/trunk/openejb3: container/openejb-core/src/main/java/org/apache/openejb/assembler/ container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ container/openejb-core/src/main/java/org/apache/openejb/con...
Date Wed, 24 Aug 2011 19:29:05 GMT
Author: rmannibucau
Date: Wed Aug 24 19:29:04 2011
New Revision: 1161238

URL: http://svn.apache.org/viewvc?rev=1161238&view=rev
Log:
fixing some issues with bval

Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/DeployerEjb.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorBuilder.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ClientModule.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConnectorModule.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/EjbModule.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Module.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/WebModule.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JaxbOpenejb.java
    openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/EJBInvocationHandler.java
    openejb/trunk/openejb3/tck/bval-embedded/pom.xml
    openejb/trunk/openejb3/tck/cdi-tomee/pom.xml
    openejb/trunk/openejb3/tck/pom.xml
    openejb/trunk/openejb3/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/DeployerEjb.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/DeployerEjb.java?rev=1161238&r1=1161237&r2=1161238&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/DeployerEjb.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/DeployerEjb.java
Wed Aug 24 19:29:04 2011
@@ -19,6 +19,7 @@ package org.apache.openejb.assembler;
 import java.io.File;
 import java.io.IOException;
 import java.math.BigInteger;
+import java.net.URL;
 import java.security.SecureRandom;
 import java.util.Collection;
 import java.util.Map;
@@ -39,7 +40,9 @@ import org.apache.openejb.config.AppModu
 import org.apache.openejb.config.ConfigurationFactory;
 import org.apache.openejb.config.DeploymentLoader;
 import org.apache.openejb.config.DeploymentModule;
+import org.apache.openejb.config.ValidationException;
 import org.apache.openejb.loader.SystemInstance;
+import org.apache.xbean.finder.ResourceFinder;
 
 @Stateless(name = "openejb/Deployer")
 @Remote(Deployer.class)
@@ -155,7 +158,14 @@ public class DeployerEjb implements Depl
 
             e.printStackTrace();
 
+            if (e instanceof javax.validation.ValidationException) {
+                throw (javax.validation.ValidationException) e;
+            }
+
             if (e instanceof OpenEJBException) {
+                if (e.getCause() instanceof javax.validation.ValidationException) {
+                    throw (javax.validation.ValidationException) e.getCause();
+                }
                 throw (OpenEJBException) e;
             }
             throw new OpenEJBException(e);

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorBuilder.java?rev=1161238&r1=1161237&r2=1161238&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorBuilder.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorBuilder.java
Wed Aug 24 19:29:04 2011
@@ -17,6 +17,7 @@
 package org.apache.openejb.assembler.classic;
 
 import java.io.InputStream;
+import java.util.List;
 import java.util.Map;
 import javax.validation.Configuration;
 import javax.validation.ConstraintValidatorFactory;
@@ -24,7 +25,10 @@ import javax.validation.MessageInterpola
 import javax.validation.TraversableResolver;
 import javax.validation.Validation;
 import javax.validation.ValidationException;
+import javax.validation.ValidationProviderResolver;
 import javax.validation.ValidatorFactory;
+import javax.validation.bootstrap.GenericBootstrap;
+import javax.validation.spi.ValidationProvider;
 import javax.xml.bind.JAXBElement;
 import org.apache.openejb.jee.bval.PropertyType;
 import org.apache.openejb.jee.bval.ValidationConfigType;
@@ -68,7 +72,17 @@ public final class ValidatorBuilder {
                 factory = Validation.buildDefaultValidatorFactory();
             } else {
                 Configuration<?> configuration = getConfig(config);
-                factory = configuration.buildValidatorFactory();
+                try {
+                    factory = configuration.buildValidatorFactory();
+                } catch (ValidationException ve) {
+                    Thread.currentThread().setContextClassLoader(ValidatorBuilder.class.getClassLoader());
+                    factory = Validation.buildDefaultValidatorFactory();
+                    Thread.currentThread().setContextClassLoader(classLoader);
+
+                    logger.warning("Unable create validator factory with config " + config
+                        + " (" + ve.getMessage() + ")."
+                        + " Default factory will be used.");
+                }
                 configuration.ignoreXmlConfiguration();
             }
         } finally {
@@ -90,12 +104,21 @@ public final class ValidatorBuilder {
                 target = Validation.byProvider(clazz).configure();
                 logger.info("Using " + providerClassName + " as validation provider.");
             } catch (ClassNotFoundException e) {
-                logger.warning("Unable to load provider class "+providerClassName, e);
+                logger.warning("Unable to load provider class " + providerClassName, e);
+            } catch (ValidationException ve) {
+                logger.warning("Unable create validator factory with provider " + providerClassName
+                        + " (" + ve.getMessage() + ")."
+                        + " Default one will be used.");
             }
         }
         if (target == null) {
+            // force to use container provider to ignore any conflicting configuration
+            Thread.currentThread().setContextClassLoader(ValidatorBuilder.class.getClassLoader());
             target = Validation.byDefaultProvider().configure();
+            Thread.currentThread().setContextClassLoader(classLoader);
         }
+        // config is manage here so ignore provider parsing
+        target.ignoreXmlConfiguration();
 
         String messageInterpolatorClass = info.messageInterpolatorClass;
         if (messageInterpolatorClass != null) {
@@ -146,9 +169,10 @@ public final class ValidatorBuilder {
             }
             InputStream in = classLoader.getResourceAsStream(mappingFileName);
             if (in == null) {
-                throw new ValidationException("Unable to open input stream for mapping file
" + mappingFileName);
+                logger.warning("Unable to open input stream for mapping file " + mappingFileName
+ ". It will be ignored");
+            } else {
+                target.addMapping(in);
             }
-            target.addMapping(in);
         }
 
         return target;

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ClientModule.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ClientModule.java?rev=1161238&r1=1161237&r2=1161238&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ClientModule.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ClientModule.java
Wed Aug 24 19:29:04 2011
@@ -35,7 +35,6 @@ import java.io.File;
 public class ClientModule extends Module implements DeploymentModule {
     private final ValidationContext validation;
     private ApplicationClient applicationClient;
-    private ClassLoader classLoader;
     private String mainClass;
     private boolean ejbModuleGenerated;
     private AtomicReference<IAnnotationFinder> finder;
@@ -46,7 +45,7 @@ public class ClientModule extends Module
 
     public ClientModule(ApplicationClient applicationClient, ClassLoader classLoader, String
jarLocation, String mainClass, String moduleId) {
         this.applicationClient = applicationClient;
-        this.classLoader = classLoader;
+        setClassLoader(classLoader);
         this.mainClass = mainClass;
         
         File file = (jarLocation == null) ? null : new File(jarLocation);
@@ -114,14 +113,6 @@ public class ClientModule extends Module
         return remoteClients;
     }
 
-    public ClassLoader getClassLoader() {
-        return classLoader;
-    }
-
-    public void setClassLoader(ClassLoader classLoader) {
-        this.classLoader = classLoader;
-    }
-
     public String getMainClass() {
         return mainClass;
     }

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConnectorModule.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConnectorModule.java?rev=1161238&r1=1161237&r2=1161238&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConnectorModule.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConnectorModule.java
Wed Aug 24 19:29:04 2011
@@ -36,7 +36,6 @@ public class ConnectorModule extends Mod
     private final ValidationContext validation;
 
     private Connector connector;
-    private ClassLoader classLoader;
     private final List<URL> libraries = new ArrayList<URL>();
     private final Set<String> watchedResources = new TreeSet<String>();
 
@@ -50,7 +49,7 @@ public class ConnectorModule extends Mod
 
     public ConnectorModule(Connector connector, ClassLoader classLoader, String jarLocation,
String moduleId) {
         this.connector = connector;
-        this.classLoader = classLoader;
+        setClassLoader(classLoader);
 
         File file = (jarLocation == null) ? null : new File(jarLocation);
         this.id = new ID(null, connector, moduleId, file, null, this);
@@ -85,14 +84,6 @@ public class ConnectorModule extends Mod
         this.connector = connector;
     }
 
-    public ClassLoader getClassLoader() {
-        return classLoader;
-    }
-
-    public void setClassLoader(ClassLoader classLoader) {
-        this.classLoader = classLoader;
-    }
-
     public List<URL> getLibraries() {
         return libraries;
     }

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java?rev=1161238&r1=1161237&r2=1161238&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
Wed Aug 24 19:29:04 2011
@@ -1109,7 +1109,7 @@ public class DeploymentLoader implements
         }
     }
 
-    private static Map<String, URL> getDescriptors(URL moduleUrl) throws OpenEJBException
{
+    public static Map<String, URL> getDescriptors(URL moduleUrl) throws OpenEJBException
{
 
         ResourceFinder finder = new ResourceFinder(moduleUrl);
         return getDescriptors(finder);
@@ -1136,7 +1136,7 @@ public class DeploymentLoader implements
 
         if (map.size() == 0) {
 
-            String[] known = {"web.xml", "ejb-jar.xml", "openejb-jar.xml", "env-entries.properties",
"beans.xml", "ra.xml", "application.xml", "application-client.xml", "persistence.xml"};
+            String[] known = {"web.xml", "ejb-jar.xml", "openejb-jar.xml", "env-entries.properties",
"beans.xml", "ra.xml", "application.xml", "application-client.xml", "persistence.xml", "validation.xml"};
             for (String descriptor : known) {
 
                 final URL url = finder.getResource(ddDir + descriptor);

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/EjbModule.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/EjbModule.java?rev=1161238&r1=1161237&r2=1161238&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/EjbModule.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/EjbModule.java
Wed Aug 24 19:29:04 2011
@@ -41,8 +41,6 @@ public class EjbModule extends Module im
 
     private final ValidationContext validation;
 
-    private ClassLoader classLoader;
-
     private EjbJar ejbJar;
     private OpenejbJar openejbJar;
     private Webservices webservices;
@@ -68,7 +66,7 @@ public class EjbModule extends Module im
         if (classLoader == null) {
             throw new NullPointerException("classLoader is null");
         }
-        this.classLoader = classLoader;
+        setClassLoader(classLoader);
         this.ejbJar = ejbJar;
         this.openejbJar = openejbJar;
 
@@ -116,14 +114,6 @@ public class EjbModule extends Module im
         return validation;
     }
 
-    public ClassLoader getClassLoader() {
-        return classLoader;
-    }
-
-    public void setClassLoader(ClassLoader classLoader) {
-        this.classLoader = classLoader;
-    }
-
     public EjbJar getEjbJar() {
         return ejbJar;
     }

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Module.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Module.java?rev=1161238&r1=1161237&r2=1161238&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Module.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Module.java
Wed Aug 24 19:29:04 2011
@@ -26,6 +26,8 @@ public class Module {
     
     private boolean isStandaloneModule = true;
 
+    private ClassLoader classLoader;
+
     private ValidationConfigType validationConfig;
     private final Map<String, Object> altDDs = new HashMap<String, Object>();
     private String uniqueId;
@@ -57,6 +59,13 @@ public class Module {
     public void setStandaloneModule(boolean isStandalone) {
         isStandaloneModule = isStandalone;
     }    
-    
+
+    public ClassLoader getClassLoader() {
+        return classLoader;
+    }
+
+    public void setClassLoader(ClassLoader classLoader) {
+        this.classLoader = classLoader;
+    }
        
 }

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java?rev=1161238&r1=1161237&r2=1161238&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
Wed Aug 24 19:29:04 2011
@@ -16,22 +16,6 @@
  */
 package org.apache.openejb.config;
 
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.List;
-import javax.wsdl.Definition;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
 import org.apache.openejb.OpenEJBException;
 import org.apache.openejb.config.sys.JaxbOpenejb;
 import org.apache.openejb.core.webservices.WsdlResolver;
@@ -56,13 +40,34 @@ import org.apache.openejb.jee.oejb2.Jaxb
 import org.apache.openejb.jee.oejb2.OpenejbJarType;
 import org.apache.openejb.jee.oejb3.JaxbOpenejbJar3;
 import org.apache.openejb.jee.oejb3.OpenejbJar;
+import org.apache.openejb.util.LogCategory;
+import org.apache.openejb.util.Logger;
 import org.apache.openejb.util.URLs;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
 
+import javax.wsdl.Definition;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FilterInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.List;
+
 public class ReadDescriptors implements DynamicDeployer {
+    public static final Logger logger = Logger.getInstance(LogCategory.OPENEJB_STARTUP, ReadDescriptors.class);
+
     @SuppressWarnings({"unchecked"})
     public AppModule deploy(AppModule appModule) throws OpenEJBException {
         for (EjbModule ejbModule : appModule.getEjbModules()) {
@@ -132,13 +137,19 @@ public class ReadDescriptors implements 
             return;
         }
         URL url = (URL) module.getAltDDs().get("validation.xml");
+        if (url == null) { // library but not a module case
+            url = module.getClassLoader().getResource("META-INF/validation.xml");
+            if (url != null) {
+                module.getAltDDs().put("validation.xml", url);
+            }
+        }
         if (url != null) {
             ValidationConfigType validationConfigType;
             try {
-                validationConfigType = JaxbOpenejb.unmarshal(ValidationConfigType.class,
url.openStream());
+                validationConfigType = JaxbOpenejb.unmarshal(ValidationConfigType.class,
url.openStream(), false);
                 module.setValidationConfig(validationConfigType);
-            } catch (Throwable t) {
-                throw new OpenEJBException("Unable to create module ValidatorFactory instance.
 Using default factory");
+            } catch (Exception e) {
+                logger.warning("can't read " + url.toString() + " to construct a validation
factory, it will be ignored");
             }
         }
     }

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/WebModule.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/WebModule.java?rev=1161238&r1=1161237&r2=1161238&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/WebModule.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/WebModule.java
Wed Aug 24 19:29:04 2011
@@ -42,7 +42,6 @@ public class WebModule extends Module im
     private Webservices webservices;
     private String host;
     private String contextRoot;
-    private ClassLoader classLoader;
     private final List<TldTaglib> taglibs = new ArrayList<TldTaglib>();
     private final Set<String> watchedResources = new TreeSet<String>();
     // List of all faces configuration files found in this web module
@@ -76,7 +75,7 @@ public class WebModule extends Module im
         }
         if (contextRoot.startsWith("/")) contextRoot = contextRoot.substring(1);
         this.contextRoot = contextRoot;
-        this.classLoader = classLoader;
+        setClassLoader(classLoader);
 
         if (webApp != null) webApp.setContextRoot(contextRoot);
     }
@@ -134,14 +133,6 @@ public class WebModule extends Module im
         this.webservices = webservices;
     }
 
-    public ClassLoader getClassLoader() {
-        return classLoader;
-    }
-
-    public void setClassLoader(ClassLoader classLoader) {
-        this.classLoader = classLoader;
-    }
-
     public String getContextRoot() {
         return contextRoot;
     }

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JaxbOpenejb.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JaxbOpenejb.java?rev=1161238&r1=1161237&r2=1161238&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JaxbOpenejb.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JaxbOpenejb.java
Wed Aug 24 19:29:04 2011
@@ -302,8 +302,7 @@ public abstract class JaxbOpenejb {
         return jaxbContext;
     }
 
-    @SuppressWarnings({"unchecked"})
-    public static <T> T unmarshal(Class<T> type, InputStream in) throws ParserConfigurationException,
SAXException, JAXBException {
+    public static <T> T unmarshal(Class<T> type, InputStream in, boolean filter)
throws ParserConfigurationException, SAXException, JAXBException {
         InputSource inputSource = new InputSource(in);
 
         SAXParserFactory factory = SAXParserFactory.newInstance();
@@ -320,20 +319,28 @@ public abstract class JaxbOpenejb {
             }
         });
 
-
-        NamespaceFilter xmlFilter = new NamespaceFilter(parser.getXMLReader());
-        xmlFilter.setContentHandler(unmarshaller.getUnmarshallerHandler());
-
-        SAXSource source = new SAXSource(xmlFilter, inputSource);
+        SAXSource source;
+        if (filter) {
+            NamespaceFilter xmlFilter = new NamespaceFilter(parser.getXMLReader());
+            xmlFilter.setContentHandler(unmarshaller.getUnmarshallerHandler());
+            source = new SAXSource(xmlFilter, inputSource);
+        } else {
+            source = new SAXSource(inputSource);
+        }
 
         currentPublicId.set(new TreeSet<String>());
         try {
-            return (T) unmarshaller.unmarshal(source);
+            return unmarshaller.unmarshal(source, type).getValue();
         } finally {
             currentPublicId.set(null);
         }
     }
 
+    @SuppressWarnings({"unchecked"})
+    public static <T> T unmarshal(Class<T> type, InputStream in) throws ParserConfigurationException,
SAXException, JAXBException {
+        return unmarshal(type, in, true);
+    }
+
     public static class NamespaceFilter extends XMLFilterImpl {
 
         public NamespaceFilter(XMLReader xmlReader) {

Modified: openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/EJBInvocationHandler.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/EJBInvocationHandler.java?rev=1161238&r1=1161237&r2=1161238&view=diff
==============================================================================
--- openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/EJBInvocationHandler.java
(original)
+++ openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/EJBInvocationHandler.java
Wed Aug 24 19:29:04 2011
@@ -41,6 +41,7 @@ import javax.ejb.EJBObject;
 import javax.ejb.EJBHome;
 import javax.ejb.NoSuchEJBException;
 import javax.ejb.EJBTransactionRolledbackException;
+import javax.validation.ValidationException;
 
 public abstract class EJBInvocationHandler implements InvocationHandler, Serializable {
 
@@ -230,6 +231,7 @@ public abstract class EJBInvocationHandl
             if (e instanceof AccessException) {
                 return new AccessLocalException(e.getMessage()).initCause(getCause(e));
             }
+
             return new EJBException(e.getMessage()).initCause(getCause(e));
         }
 

Modified: openejb/trunk/openejb3/tck/bval-embedded/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/tck/bval-embedded/pom.xml?rev=1161238&r1=1161237&r2=1161238&view=diff
==============================================================================
--- openejb/trunk/openejb3/tck/bval-embedded/pom.xml (original)
+++ openejb/trunk/openejb3/tck/bval-embedded/pom.xml Wed Aug 24 19:29:04 2011
@@ -61,14 +61,10 @@
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-log4j12</artifactId>
-      <version>1.6.1</version>
-      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.testng</groupId>
       <artifactId>testng</artifactId>
-      <version>6.0.1</version>
-      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.hibernate.jsr303.tck</groupId>

Modified: openejb/trunk/openejb3/tck/cdi-tomee/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/tck/cdi-tomee/pom.xml?rev=1161238&r1=1161237&r2=1161238&view=diff
==============================================================================
--- openejb/trunk/openejb3/tck/cdi-tomee/pom.xml (original)
+++ openejb/trunk/openejb3/tck/cdi-tomee/pom.xml Wed Aug 24 19:29:04 2011
@@ -70,7 +70,6 @@
     <dependency>
       <groupId>org.testng</groupId>
       <artifactId>testng</artifactId>
-      <version>6.0.1</version>
     </dependency>
   </dependencies>
   <build>

Modified: openejb/trunk/openejb3/tck/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/tck/pom.xml?rev=1161238&r1=1161237&r2=1161238&view=diff
==============================================================================
--- openejb/trunk/openejb3/tck/pom.xml (original)
+++ openejb/trunk/openejb3/tck/pom.xml Wed Aug 24 19:29:04 2011
@@ -31,9 +31,10 @@
 
   <modules>
     <module>cdi-embedded</module>
-     <module>cdi-tomee</module>
+    <module>cdi-tomee</module>
     <module>bval-embedded</module>
     <module>tck-common</module>
+    <module>bval-tomee</module>
   </modules>
 
   <repositories>
@@ -54,4 +55,21 @@
       </snapshots>
     </repository>
   </repositories>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-log4j12</artifactId>
+        <version>1.6.1</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.testng</groupId>
+        <artifactId>testng</artifactId>
+        <version>6.0.1</version>
+        <scope>test</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
 </project>

Modified: openejb/trunk/openejb3/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java?rev=1161238&r1=1161237&r2=1161238&view=diff
==============================================================================
--- openejb/trunk/openejb3/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java
(original)
+++ openejb/trunk/openejb3/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java
Wed Aug 24 19:29:04 2011
@@ -32,6 +32,7 @@ import org.apache.openejb.assembler.clas
 import org.apache.openejb.client.RemoteInitialContextFactory;
 import org.apache.openejb.config.Deploy;
 import org.apache.openejb.config.RemoteServer;
+import org.apache.openejb.config.ValidationException;
 import org.apache.openejb.loader.Options;
 import org.jboss.testharness.api.DeploymentException;
 import org.jboss.testharness.spi.Containers;
@@ -83,7 +84,11 @@ public class ContainersImplTomEE impleme
                 deployer = lookup();
             }
             appInfo = deployer.deploy(fileName.getAbsolutePath());
-        } catch (Exception e) {
+        } catch (Exception ex) {
+            Exception e = ex;
+            if (e.getCause() instanceof ValidationException) {
+                e = (Exception) e.getCause();
+            }
 
             if (name.contains(".broken.")) {
                 // Tests that contain the name '.broken.' are expected to fail deployment



Mime
View raw message