javax.validation.ValidationException: HV000028: Unexpected exception during isValid call.

Hibernate JIRA | Bryan Turner | 4 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    In 4.3, {{EmailValidator}} was updated to pass the value through {{IDN.toAscii}} before applying the regular expression. The Javadocs for {{IDN.toAscii}} document a set of cases which can result in an {{IllegalArgumentException}} being thrown, but {{EmailValidator}} does not attempt to catch that exception. As a result, in certain circumstances, rather than returning {{false}} the validator throws an exception. That, in turn, results in this: {noformat} javax.validation.ValidationException: HV000028: Unexpected exception during isValid call. at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:294) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:164) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:125) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:86) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:442) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:387) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:351) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:303) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:133) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] Caused by: java.lang.IllegalArgumentException: The label in the input is too long at java.net.IDN.toASCIIInternal(IDN.java:298) ~[na:1.6.0_34] at java.net.IDN.toASCII(IDN.java:101) ~[na:1.6.0_34] at java.net.IDN.toASCII(IDN.java:127) ~[na:1.6.0_34] at org.hibernate.validator.internal.constraintvalidators.EmailValidator.isValid(EmailValidator.java:45) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.constraintvalidators.EmailValidator.isValid(EmailValidator.java:24) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:291) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] {noformat} This situation was not possible in 4.2.

    Hibernate JIRA | 4 years ago | Bryan Turner
    javax.validation.ValidationException: HV000028: Unexpected exception during isValid call.
  2. 0

    In 4.3, {{EmailValidator}} was updated to pass the value through {{IDN.toAscii}} before applying the regular expression. The Javadocs for {{IDN.toAscii}} document a set of cases which can result in an {{IllegalArgumentException}} being thrown, but {{EmailValidator}} does not attempt to catch that exception. As a result, in certain circumstances, rather than returning {{false}} the validator throws an exception. That, in turn, results in this: {noformat} javax.validation.ValidationException: HV000028: Unexpected exception during isValid call. at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:294) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:164) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:125) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:86) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:442) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:387) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:351) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:303) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:133) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] Caused by: java.lang.IllegalArgumentException: The label in the input is too long at java.net.IDN.toASCIIInternal(IDN.java:298) ~[na:1.6.0_34] at java.net.IDN.toASCII(IDN.java:101) ~[na:1.6.0_34] at java.net.IDN.toASCII(IDN.java:127) ~[na:1.6.0_34] at org.hibernate.validator.internal.constraintvalidators.EmailValidator.isValid(EmailValidator.java:45) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.constraintvalidators.EmailValidator.isValid(EmailValidator.java:24) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:291) ~[hibernate-validator-4.3.0.Final.jar:4.3.0.Final] {noformat} This situation was not possible in 4.2.

    Hibernate JIRA | 4 years ago | Bryan Turner
    javax.validation.ValidationException: HV000028: Unexpected exception during isValid call.
  3. 0

    Email addresses with large invlaid email cause a ValidationException instead of failing the validation test. For a field: "too long email************************************************************************************************************************" We get the following error. javax.validation.ValidationException: HV000028: Unexpected exception during isValid call. at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:294) at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:164) at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:125) at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:86) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:442) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:387) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:351) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:303) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:604) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:469) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:312) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:133) at tmg.billing.ws.utilties.ValidationService.validate(ValidationService.java:21) at billing.ws.request.RequestCustomerValidationTest.testCustomerValidation(RequestCustomerValidationTest.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 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.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) 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.junit.runner.JUnitCore.run(JUnitCore.java:157) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) Caused by: java.lang.IllegalArgumentException: The label in the input is too long at java.net.IDN.toASCIIInternal(IDN.java:298) at java.net.IDN.toASCII(IDN.java:101) at java.net.IDN.toASCII(IDN.java:127) at org.hibernate.validator.internal.constraintvalidators.EmailValidator.isValid(EmailValidator.java:45) at org.hibernate.validator.internal.constraintvalidators.EmailValidator.isValid(EmailValidator.java:24) at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:291) ... 38 more

    Hibernate JIRA | 5 years ago | Andy Riley
    javax.validation.ValidationException: HV000028: Unexpected exception during isValid call.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Email addresses with large invlaid email cause a ValidationException instead of failing the validation test. For a field: "too long email************************************************************************************************************************" We get the following error. javax.validation.ValidationException: HV000028: Unexpected exception during isValid call. at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:294) at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:164) at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:125) at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:86) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:442) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:387) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:351) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:303) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:604) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:469) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:312) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:133) at tmg.billing.ws.utilties.ValidationService.validate(ValidationService.java:21) at billing.ws.request.RequestCustomerValidationTest.testCustomerValidation(RequestCustomerValidationTest.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 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.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) 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.junit.runner.JUnitCore.run(JUnitCore.java:157) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) Caused by: java.lang.IllegalArgumentException: The label in the input is too long at java.net.IDN.toASCIIInternal(IDN.java:298) at java.net.IDN.toASCII(IDN.java:101) at java.net.IDN.toASCII(IDN.java:127) at org.hibernate.validator.internal.constraintvalidators.EmailValidator.isValid(EmailValidator.java:45) at org.hibernate.validator.internal.constraintvalidators.EmailValidator.isValid(EmailValidator.java:24) at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:291) ... 38 more

    Hibernate JIRA | 5 years ago | Andy Riley
    javax.validation.ValidationException: HV000028: Unexpected exception during isValid call.
  6. 0

    Master branch socks related unit test failing

    GitHub | 3 years ago | Scottmitch
    java.lang.IllegalArgumentException: java.text.ParseException: A prohibited code point was found in the inputù…ø«ø§ù„

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      The label in the input is too long

      at java.net.IDN.toASCIIInternal()
    2. Java RT
      IDN.toASCII
      1. java.net.IDN.toASCIIInternal(IDN.java:298)[na:1.6.0_34]
      2. java.net.IDN.toASCII(IDN.java:101)[na:1.6.0_34]
      3. java.net.IDN.toASCII(IDN.java:127)[na:1.6.0_34]
      3 frames
    3. Curator RPC Proxy
      EmailValidator.isValid
      1. org.hibernate.validator.internal.constraintvalidators.EmailValidator.isValid(EmailValidator.java:45)[hibernate-validator-4.3.0.Final.jar:4.3.0.Final]
      2. org.hibernate.validator.internal.constraintvalidators.EmailValidator.isValid(EmailValidator.java:24)[hibernate-validator-4.3.0.Final.jar:4.3.0.Final]
      2 frames
    4. Hibernate Validator Engine
      ConstraintTree.validateSingleConstraint
      1. org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:291)[hibernate-validator-4.3.0.Final.jar:4.3.0.Final]
      1 frame