openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1816168 - /openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/cxf/MeecrowaveBus.java
Date Thu, 23 Nov 2017 16:13:51 GMT
Author: rmannibucau
Date: Thu Nov 23 16:13:51 2017
New Revision: 1816168

URL: http://svn.apache.org/viewvc?rev=1816168&view=rev
Log:
MEECROWAVE-82 better validation to activate bval

Modified:
    openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/cxf/MeecrowaveBus.java

Modified: openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/cxf/MeecrowaveBus.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/cxf/MeecrowaveBus.java?rev=1816168&r1=1816167&r2=1816168&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/cxf/MeecrowaveBus.java
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/cxf/MeecrowaveBus.java
Thu Nov 23 16:13:51 2017
@@ -91,7 +91,10 @@ public class MeecrowaveBus implements Bu
                 try { // we don't need the jaxrsbeanvalidationfeature since bean validation
cdi extension handles it normally
                     final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
                     contextClassLoader.loadClass("javax.validation.Validation");
-                    providers.add(contextClassLoader.loadClass("org.apache.cxf.jaxrs.validation.ValidationExceptionMapper").newInstance());
+                    final Object instance = contextClassLoader.loadClass("org.apache.cxf.jaxrs.validation.ValidationExceptionMapper")
+                                                       .getConstructor().newInstance();
+                    instance.getClass().getGenericInterfaces(); // validate bval can be used,
check NoClassDefFoundError javax.validation.ValidationException
+                    providers.add(instance);
                 } catch (final Exception | NoClassDefFoundError e) {
                     // no-op
                 }



Mime
View raw message