aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@gmail.com>2017-06-05 14:28:10 +0300
committerIlia Motornyi <elmot@vaadin.com>2017-06-05 14:28:10 +0300
commitbdb81a11c6deb76638a3e1f82f123d94744295a7 (patch)
treedca11fb72ee3d8f681dad5a804bfd799296e17b1
parent2767a4b2124cae475eb6325ed62a655b163187b9 (diff)
downloadvaadin-framework-bdb81a11c6deb76638a3e1f82f123d94744295a7.tar.gz
vaadin-framework-bdb81a11c6deb76638a3e1f82f123d94744295a7.zip
Improve logging when bean validation is not available
Closes #9464
-rw-r--r--server/src/main/java/com/vaadin/data/BeanValidationBinder.java2
-rw-r--r--server/src/main/java/com/vaadin/data/util/BeanUtil.java8
2 files changed, 6 insertions, 4 deletions
diff --git a/server/src/main/java/com/vaadin/data/BeanValidationBinder.java b/server/src/main/java/com/vaadin/data/BeanValidationBinder.java
index e125bc9862..c358d64ae6 100644
--- a/server/src/main/java/com/vaadin/data/BeanValidationBinder.java
+++ b/server/src/main/java/com/vaadin/data/BeanValidationBinder.java
@@ -54,7 +54,7 @@ public class BeanValidationBinder<BEAN> extends Binder<BEAN> {
throw new IllegalStateException(
BeanValidationBinder.class.getSimpleName()
+ " cannot be used because a JSR-303 Bean Validation "
- + "implementation not found on the classpath. Use "
+ + "implementation not found on the classpath or could not be initialized. Use "
+ Binder.class.getSimpleName() + " instead");
}
this.beanType = beanType;
diff --git a/server/src/main/java/com/vaadin/data/util/BeanUtil.java b/server/src/main/java/com/vaadin/data/util/BeanUtil.java
index 2a6fb4834e..a80eb8b151 100644
--- a/server/src/main/java/com/vaadin/data/util/BeanUtil.java
+++ b/server/src/main/java/com/vaadin/data/util/BeanUtil.java
@@ -24,6 +24,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
+import java.util.logging.Level;
import java.util.logging.Logger;
import com.vaadin.data.validator.BeanValidator;
@@ -236,10 +237,11 @@ public final class BeanUtil implements Serializable {
return true;
} catch (ClassNotFoundException | NoSuchMethodException
| InvocationTargetException e) {
- Logger.getLogger(BeanValidator.class.getName())
- .fine("A JSR-303 bean validation implementation not found on the classpath. "
+ Logger.getLogger(BeanValidator.class.getName()).log(Level.INFO,
+ "A JSR-303 bean validation implementation not found on the classpath or could not be initialized. "
+ BeanValidator.class.getSimpleName()
- + " cannot be used.");
+ + " cannot be used.",
+ e);
return false;
} catch (IllegalAccessException | IllegalArgumentException e) {
throw new RuntimeException(