javax.validation.UnexpectedTypeException: No validator could be found for type: java.util.List<java.lang.String>

Hibernate JIRA | Michenaud Laurent | 7 years ago
  1. 0

    [HV-264] Implement ConstraintValidator<Email, Collection<String>> - Hibernate JIRA

    atlassian.net | 1 year ago
    javax.validation.UnexpectedTypeException: No validator could be found for type: java.util.List<java.lang.String>
  2. 0

    Hibernate Community • View topic - Validation of List of primitive types

    hibernate.org | 1 year ago
    javax.validation.UnexpectedTypeException: No validator could be found for type: java.util.List<java.lang.String>
  3. 0

    Hi, I have a list of String in my bean : These strings are email and i want to validate them. So, i did in my bean : {code} @NotEmpty @Email //@Valid <= uncommenting that line doesnot change anything. List<String> emails ; {code} At execution, i've got the error : {noformat} Exception in thread "main" javax.validation.UnexpectedTypeException: No validator could be found for type: java.util.List<java.lang.String> at org.hibernate.validator.engine.ConstraintTree.verifyResolveWasUnique(ConstraintTree.java:236) at org.hibernate.validator.engine.ConstraintTree.findMatchingValidatorClass(ConstraintTree.java:219) at org.hibernate.validator.engine.ConstraintTree.getInitializedValidator(ConstraintTree.java:167) at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:113) at org.hibernate.validator.metadata.MetaConstraint.validateConstraint(MetaConstraint.java:121) at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:334) at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForRedefinedDefaultGroup(ValidatorImpl.java:278) at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:260) at org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:213) at org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:119) at com.adeuza.movalys.validation.hibernate.TestMain.main(TestMain.java:75) {noformat} I don't know if it is a bug in hibernate validator. I have looked at the JSR303 and i have not seen anything about List of primitives. You can validate per example _List<Person>_ with _@Valid_ and it works well because the validator knows about Person class. I have used a little the Oval framework and with it, you can tell if the check applies to the container, or the values inside, or the keys(for map). I don't know if you can do that with JSR303. I'm interesting with your point of view.

    Hibernate JIRA | 7 years ago | Michenaud Laurent
    javax.validation.UnexpectedTypeException: No validator could be found for type: java.util.List<java.lang.String>
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hi, I have a list of String in my bean : These strings are email and i want to validate them. So, i did in my bean : {code} @NotEmpty @Email //@Valid <= uncommenting that line doesnot change anything. List<String> emails ; {code} At execution, i've got the error : {noformat} Exception in thread "main" javax.validation.UnexpectedTypeException: No validator could be found for type: java.util.List<java.lang.String> at org.hibernate.validator.engine.ConstraintTree.verifyResolveWasUnique(ConstraintTree.java:236) at org.hibernate.validator.engine.ConstraintTree.findMatchingValidatorClass(ConstraintTree.java:219) at org.hibernate.validator.engine.ConstraintTree.getInitializedValidator(ConstraintTree.java:167) at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:113) at org.hibernate.validator.metadata.MetaConstraint.validateConstraint(MetaConstraint.java:121) at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:334) at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForRedefinedDefaultGroup(ValidatorImpl.java:278) at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:260) at org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:213) at org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:119) at com.adeuza.movalys.validation.hibernate.TestMain.main(TestMain.java:75) {noformat} I don't know if it is a bug in hibernate validator. I have looked at the JSR303 and i have not seen anything about List of primitives. You can validate per example _List<Person>_ with _@Valid_ and it works well because the validator knows about Person class. I have used a little the Oval framework and with it, you can tell if the check applies to the container, or the values inside, or the keys(for map). I don't know if you can do that with JSR303. I'm interesting with your point of view.

    Hibernate JIRA | 7 years ago | Michenaud Laurent
    javax.validation.UnexpectedTypeException: No validator could be found for type: java.util.List<java.lang.String>
  6. 0

    Hibernate Validator throwing Exception "No validator could be found for type: java.math.BigDecimal"

    Stack Overflow | 3 years ago | Rahul Agrawal
    javax.validation.UnexpectedTypeException: No validator could be found for type: java.math.BigDecimal

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.validation.UnexpectedTypeException

      No validator could be found for type: java.util.List<java.lang.String>

      at org.hibernate.validator.engine.ConstraintTree.verifyResolveWasUnique()
    2. Vaadin
      ConstraintTree.validateConstraints
      1. org.hibernate.validator.engine.ConstraintTree.verifyResolveWasUnique(ConstraintTree.java:236)
      2. org.hibernate.validator.engine.ConstraintTree.findMatchingValidatorClass(ConstraintTree.java:219)
      3. org.hibernate.validator.engine.ConstraintTree.getInitializedValidator(ConstraintTree.java:167)
      4. org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:113)
      4 frames
    3. Embedded GlassFish Web
      MetaConstraint.validateConstraint
      1. org.hibernate.validator.metadata.MetaConstraint.validateConstraint(MetaConstraint.java:121)
      1 frame
    4. Vaadin
      ValidatorImpl.validate
      1. org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:334)
      2. org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForRedefinedDefaultGroup(ValidatorImpl.java:278)
      3. org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:260)
      4. org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:213)
      5. org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:119)
      5 frames
    5. com.adeuza.movalys
      TestMain.main
      1. com.adeuza.movalys.validation.hibernate.TestMain.main(TestMain.java:75)
      1 frame