javax.validation.UnexpectedTypeException: No validator could be found for type: com.edb.payment.pays.core.model.account.NorwegianAccountNumber

Hibernate JIRA | David J. M. Karlsen | 6 years ago
  1. 0

    I have a interface TypeA and and implementation of it ConcreteTypeA implements TypeA. I have created a JSR-303 constraint both for ConcreteTypeA as well as TypeA - and pointed my constraint to them with @Constraint( validatedBy= ) - but still Hibernate does not find the validator for it: javax.validation.UnexpectedTypeException: No validator could be found for type: com.edb.payment.pays.core.model.account.NorwegianAccountNumber at org.hibernate.validator.engine.ConstraintTree.verifyResolveWasUnique(ConstraintTree.java:383) at org.hibernate.validator.engine.ConstraintTree.findMatchingValidatorClass(ConstraintTree.java:364) at org.hibernate.validator.engine.ConstraintTree.getInitializedValidator(ConstraintTree.java:313) at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:144) at org.hibernate.validator.engine.ConstraintTree.validateComposingConstraints(ConstraintTree.java:233) at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:128) at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:117) at org.hibernate.validator.metadata.MetaConstraint.validateConstraint(MetaConstraint.java:84) at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:408) at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForRedefinedDefaultGroup(ValidatorImpl.java:341) at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:325) at org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:281) at org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:129) at com.edb.payment.pays.core.util.validation.constraints.NorwegianAccountNumberValidatorTest.isValid(NorwegianAccountNumberValidatorTest.java:34) at com.edb.payment.pays.core.util.validation.constraints.NorwegianAccountNumberValidatorTest.assertValid(NorwegianAccountNumberValidatorTest.java:44) at com.edb.payment.pays.core.util.validation.constraints.NorwegianAccountNumberValidatorTest.testAValidAccountNumberWhichHasControlSumZero(NorwegianAccountNumberValidatorTest.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:600) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) The same implementation works with Apache Bval: http://incubator.apache.org/bval/cwiki/downloads.html

    Hibernate JIRA | 6 years ago | David J. M. Karlsen
    javax.validation.UnexpectedTypeException: No validator could be found for type: com.edb.payment.pays.core.model.account.NorwegianAccountNumber
  2. 0

    I have a interface TypeA and and implementation of it ConcreteTypeA implements TypeA. I have created a JSR-303 constraint both for ConcreteTypeA as well as TypeA - and pointed my constraint to them with @Constraint( validatedBy= ) - but still Hibernate does not find the validator for it: javax.validation.UnexpectedTypeException: No validator could be found for type: com.edb.payment.pays.core.model.account.NorwegianAccountNumber at org.hibernate.validator.engine.ConstraintTree.verifyResolveWasUnique(ConstraintTree.java:383) at org.hibernate.validator.engine.ConstraintTree.findMatchingValidatorClass(ConstraintTree.java:364) at org.hibernate.validator.engine.ConstraintTree.getInitializedValidator(ConstraintTree.java:313) at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:144) at org.hibernate.validator.engine.ConstraintTree.validateComposingConstraints(ConstraintTree.java:233) at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:128) at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:117) at org.hibernate.validator.metadata.MetaConstraint.validateConstraint(MetaConstraint.java:84) at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:408) at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForRedefinedDefaultGroup(ValidatorImpl.java:341) at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:325) at org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:281) at org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:129) at com.edb.payment.pays.core.util.validation.constraints.NorwegianAccountNumberValidatorTest.isValid(NorwegianAccountNumberValidatorTest.java:34) at com.edb.payment.pays.core.util.validation.constraints.NorwegianAccountNumberValidatorTest.assertValid(NorwegianAccountNumberValidatorTest.java:44) at com.edb.payment.pays.core.util.validation.constraints.NorwegianAccountNumberValidatorTest.testAValidAccountNumberWhichHasControlSumZero(NorwegianAccountNumberValidatorTest.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:600) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) The same implementation works with Apache Bval: http://incubator.apache.org/bval/cwiki/downloads.html

    Hibernate JIRA | 6 years ago | David J. M. Karlsen
    javax.validation.UnexpectedTypeException: No validator could be found for type: com.edb.payment.pays.core.model.account.NorwegianAccountNumber
  3. 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
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    JSR 303 - Hibernate Validation 4.2.0 - UnexpectedTypeException - @Valid and @Size in combination

    Stack Overflow | 5 years ago | Walter
    javax.validation.UnexpectedTypeException: No validator could be found for type: B
  6. 0

    Captain Debug's Blog: Misapplying JSR 303 Annotations

    captaindebug.com | 1 year ago
    javax.validation.UnexpectedTypeException: No validator could be found for type: java.lang.Integer

    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: com.edb.payment.pays.core.model.account.NorwegianAccountNumber

      at org.hibernate.validator.engine.ConstraintTree.verifyResolveWasUnique()
    2. Vaadin
      ConstraintTree.validateConstraints
      1. org.hibernate.validator.engine.ConstraintTree.verifyResolveWasUnique(ConstraintTree.java:383)
      2. org.hibernate.validator.engine.ConstraintTree.findMatchingValidatorClass(ConstraintTree.java:364)
      3. org.hibernate.validator.engine.ConstraintTree.getInitializedValidator(ConstraintTree.java:313)
      4. org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:144)
      5. org.hibernate.validator.engine.ConstraintTree.validateComposingConstraints(ConstraintTree.java:233)
      6. org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:128)
      7. org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:117)
      7 frames
    3. Embedded GlassFish Web
      MetaConstraint.validateConstraint
      1. org.hibernate.validator.metadata.MetaConstraint.validateConstraint(MetaConstraint.java:84)
      1 frame
    4. Vaadin
      ValidatorImpl.validate
      1. org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:408)
      2. org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForRedefinedDefaultGroup(ValidatorImpl.java:341)
      3. org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:325)
      4. org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:281)
      5. org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:129)
      5 frames
    5. com.edb.payment
      NorwegianAccountNumberValidatorTest.testAValidAccountNumberWhichHasControlSumZero
      1. com.edb.payment.pays.core.util.validation.constraints.NorwegianAccountNumberValidatorTest.isValid(NorwegianAccountNumberValidatorTest.java:34)
      2. com.edb.payment.pays.core.util.validation.constraints.NorwegianAccountNumberValidatorTest.assertValid(NorwegianAccountNumberValidatorTest.java:44)
      3. com.edb.payment.pays.core.util.validation.constraints.NorwegianAccountNumberValidatorTest.testAValidAccountNumberWhichHasControlSumZero(NorwegianAccountNumberValidatorTest.java:74)
      3 frames
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:600)
      4 frames
    7. JUnit
      ParentRunner.run
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      5. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      6. org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48)
      7. org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
      8. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
      9. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
      10. org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      11. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      12. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      13. org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      14. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      15. org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      15 frames
    8. JUnit4 Runner
      JUnit4TestReference.run
      1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
      1 frame
    9. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      5 frames