javax.validation.ValidationException: HV000108: Attempt to specify an array where single value is expected.

Hibernate JIRA | Zhelyazko Chobantonov | 7 months 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

    All issues are related to validation using XML as configuration Issue 1: javax.validation.ValidationException: HV000136: The specified constraint annotation class MyConstraint cannot be loaded. at org.hibernate.validator.internal.xml.MetaConstraintBuilder.buildMetaConstraint(MetaConstraintBuilder.java:67) at org.hibernate.validator.internal.xml.ConstrainedTypeBuilder.buildConstrainedType(ConstrainedTypeBuilder.java:64) at org.hibernate.validator.internal.xml.XmlMappingParser.parse(XmlMappingParser.java:130) at org.hibernate.validator.internal.metadata.provider.XmlMetaDataProvider.<init>(XmlMetaDataProvider.java:51) at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.<init>(ValidatorFactoryImpl.java:144) at org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:45) at org.hibernate.validator.internal.engine.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:236) at ValidationConfigurationIssues.testELContextFromXmlConfiguration(ValidationConfigurationIssues.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: javax.validation.ValidationException: HV000065: Unable to load class: java.lang.MyConstraint. at org.hibernate.validator.internal.util.privilegedactions.LoadClass.loadNonValidatorClass(LoadClass.java:100) at org.hibernate.validator.internal.util.privilegedactions.LoadClass.run(LoadClass.java:53) at org.hibernate.validator.internal.util.privilegedactions.LoadClass.run(LoadClass.java:29) at org.hibernate.validator.internal.util.ReflectionHelper.run(ReflectionHelper.java:674) at org.hibernate.validator.internal.util.ReflectionHelper.loadClass(ReflectionHelper.java:154) at org.hibernate.validator.internal.util.ReflectionHelper.loadClass(ReflectionHelper.java:186) at org.hibernate.validator.internal.util.ReflectionHelper.loadClass(ReflectionHelper.java:158) at org.hibernate.validator.internal.xml.MetaConstraintBuilder.buildMetaConstraint(MetaConstraintBuilder.java:64) This happen when MyConstraint is in java default package and <default-package>java.lang</default-package> Issue 2: having xml pretty formatted produce following exception : java.lang.IllegalArgumentException: testvalidation.MyConstraint$AdditionalConstraint is not an enum type at java.lang.Class.enumConstantDirectory(Class.java:3344) at java.lang.Enum.valueOf(Enum.java:232) at org.hibernate.validator.internal.xml.MetaConstraintBuilder.convertStringToReturnType(MetaConstraintBuilder.java:258) at org.hibernate.validator.internal.xml.MetaConstraintBuilder.getSingleValue(MetaConstraintBuilder.java:161) at org.hibernate.validator.internal.xml.MetaConstraintBuilder.getElementValue(MetaConstraintBuilder.java:140) at org.hibernate.validator.internal.xml.MetaConstraintBuilder.buildMetaConstraint(MetaConstraintBuilder.java:81) at org.hibernate.validator.internal.xml.ConstrainedTypeBuilder.buildConstrainedType(ConstrainedTypeBuilder.java:64) at org.hibernate.validator.internal.xml.XmlMappingParser.parse(XmlMappingParser.java:130) at org.hibernate.validator.internal.metadata.provider.XmlMetaDataProvider.<init>(XmlMetaDataProvider.java:51) at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.<init>(ValidatorFactoryImpl.java:144) at org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:45) at org.hibernate.validator.internal.engine.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:236) at testvalidation.ValidationConfigurationIssues.testELContextFromXmlConfiguration(ValidationConfigurationIssues.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Issue 3: Empty sub annotation attribute generate following exception: javax.validation.ValidationException: HV000108: Attempt to specify an array where single value is expected. at org.hibernate.validator.internal.xml.MetaConstraintBuilder.getElementValue(MetaConstraintBuilder.java:133) at org.hibernate.validator.internal.xml.MetaConstraintBuilder.buildAnnotation(MetaConstraintBuilder.java:107) at org.hibernate.validator.internal.xml.MetaConstraintBuilder.getSingleValue(MetaConstraintBuilder.java:176) at org.hibernate.validator.internal.xml.MetaConstraintBuilder.getElementValue(MetaConstraintBuilder.java:140) at org.hibernate.validator.internal.xml.MetaConstraintBuilder.buildMetaConstraint(MetaConstraintBuilder.java:81) at org.hibernate.validator.internal.xml.ConstrainedTypeBuilder.buildConstrainedType(ConstrainedTypeBuilder.java:64) at org.hibernate.validator.internal.xml.XmlMappingParser.parse(XmlMappingParser.java:130) at org.hibernate.validator.internal.metadata.provider.XmlMetaDataProvider.<init>(XmlMetaDataProvider.java:51) at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.<init>(ValidatorFactoryImpl.java:144) at org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:45) at org.hibernate.validator.internal.engine.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:236) at testvalidation.ValidationConfigurationIssues.testXmlConfiguration(ValidationConfigurationIssues.java:47) at testvalidation.ValidationConfigurationIssues.testXmlConfiguration_constraint_empty(ValidationConfigurationIssues.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

    Hibernate JIRA | 7 months ago | Zhelyazko Chobantonov
    javax.validation.ValidationException: HV000108: Attempt to specify an array where single value is expected.
  2. 0

    See http://bugs.sun.com/view_bug.do?bug_id=6434149 {noformat} org.hibernate.beanvalidation.tck.tests.xmlconfiguration.constructorvalidation.ConstructorValidationTest tesConstructorCrossParameterParameter "javax.validation.ValidationException: HV000134: Unable to load parameter of type '[LCustomer;' in org.hibernate.beanvalidation.tck.tests.xmlconfiguration.constructorvalidation.CustomerRepository. at org.hibernate.validator.internal.xml.ConstrainedExecutableBuilder.createParameterTypes(ConstrainedExecutableBuilder.java:318) at org.hibernate.validator.internal.xml.ConstrainedExecutableBuilder.buildConstructorConstrainedExecutable(ConstrainedExecutableBuilder.java:130) at org.hibernate.validator.internal.xml.XmlMappingParser.parse(XmlMappingParser.java:155) at org.hibernate.validator.internal.metadata.provider.XmlMetaDataProvider.<init>(XmlMetaDataProvider.java:51) at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.<init>(ValidatorFactoryImpl.java:123) at org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:45) at org.hibernate.validator.internal.engine.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:199) at org.hibernate.beanvalidation.tck.util.TestUtil.getValidatorFactoryUnderTest(TestUtil.java:93) at org.hibernate.beanvalidation.tck.util.TestUtil.getValidatorUnderTest(TestUtil.java:81) at org.hibernate.beanvalidation.tck.util.TestUtil.getConstructorDescriptor(TestUtil.java:381) at org.hibernate.beanvalidation.tck.tests.xmlconfiguration.constructorvalidation.ConstructorValidationTest.tesConstructorCrossParameterParameter(ConstructorValidationTest.java:101) {noformat}

    Hibernate JIRA | 4 years ago | Hardy Ferentschik
    javax.validation.ValidationException: HV000134: Unable to load parameter of type '[LCustomer;' in org.hibernate.beanvalidation.tck.tests.xmlconfiguration.constructorvalidation.CustomerRepository.
  3. 0

    Use Yarn task sink depolyer

    Stack Overflow | 5 days ago | Shahbour
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bindingService' defined in org.springframework.cloud.stream.config.BindingServiceConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.stream.binding.BindingService]: Factory method 'bindingService' threw exception; nested exception is javax.validation.ValidationException: HV000183: Unable to initialize 'javax.el.ExpressionFactory'. Check that you have the EL dependencies on the classpath, or use ParameterMessageInterpolator instead
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

Root Cause Analysis

  1. javax.validation.ValidationException

    HV000108: Attempt to specify an array where single value is expected.

    at org.hibernate.validator.internal.xml.MetaConstraintBuilder.getElementValue()
  2. Hibernate Validator Engine
    ConfigurationImpl.buildValidatorFactory
    1. org.hibernate.validator.internal.xml.MetaConstraintBuilder.getElementValue(MetaConstraintBuilder.java:133)
    2. org.hibernate.validator.internal.xml.MetaConstraintBuilder.buildAnnotation(MetaConstraintBuilder.java:107)
    3. org.hibernate.validator.internal.xml.MetaConstraintBuilder.getSingleValue(MetaConstraintBuilder.java:176)
    4. org.hibernate.validator.internal.xml.MetaConstraintBuilder.getElementValue(MetaConstraintBuilder.java:140)
    5. org.hibernate.validator.internal.xml.MetaConstraintBuilder.buildMetaConstraint(MetaConstraintBuilder.java:81)
    6. org.hibernate.validator.internal.xml.ConstrainedTypeBuilder.buildConstrainedType(ConstrainedTypeBuilder.java:64)
    7. org.hibernate.validator.internal.xml.XmlMappingParser.parse(XmlMappingParser.java:130)
    8. org.hibernate.validator.internal.metadata.provider.XmlMetaDataProvider.<init>(XmlMetaDataProvider.java:51)
    9. org.hibernate.validator.internal.engine.ValidatorFactoryImpl.<init>(ValidatorFactoryImpl.java:144)
    10. org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:45)
    11. org.hibernate.validator.internal.engine.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:236)
    11 frames
  3. testvalidation
    ValidationConfigurationIssues.testXmlConfiguration_constraint_empty
    1. testvalidation.ValidationConfigurationIssues.testXmlConfiguration(ValidationConfigurationIssues.java:47)
    2. testvalidation.ValidationConfigurationIssues.testXmlConfiguration_constraint_empty(ValidationConfigurationIssues.java:40)
    2 frames
  4. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:497)
    4 frames
  5. JUnit
    ParentRunner.run
    1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
    2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
    4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    5. org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
    6. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
    7. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
    8. org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    9. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    10. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    11. org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    12. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    13. org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    13 frames
  6. JUnit4 Runner
    JUnit4TestReference.run
    1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    1 frame
  7. 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:459)
    3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
    4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
    5 frames