javax.validation.ValidationException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • GitHub comment 1939#235261421
    via GitHub by btyamadasun
    ,
  • I have the following validation rules defined in an interface: {code} @NotNull @DecimalMax(value= "90.0") @DecimalMin(value= "-90.0") Double getLatitude(); {code} In my tests, I also pass unexpected values such as {{Double.NAN}} or {{Double.POSITIVE_INFINITY}}. This triggers an exception: {noformat} javax.validation.ValidationException: HV000028: Unexpected exception during isValid call. at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateSingleConstraint(ConstraintTree.java:286) at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:133) at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:91) at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:83) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:547) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:487) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:451) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:403) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:206) {noformat} The exception is caused by the call to {{BigDecimal.valueOf(double val)}} in {{org.hibernate.validator.internal.constraintvalidators.bv.DecimalMaxValidatorForNumber}}, which throws an exception if val is infinite or NaN. The issue can be reproduced using the attached project.
    via by Xavier Sosnovsky,
  • Spring ApplicationContext with AJAX call
    via Stack Overflow by user1482309
    ,
  • Hello, I have mandatory field in object which I want to validate: {code} @NotNull private final LocalDate datumHinfahrt; {code} But when I'm trying to validate it using the Hibernate Validator I receive an exception: {noformat} javax.validation.ValidationException: HV000041: Call to TraversableResolver.isReachable() threw an exception. at org.hibernate.validator.internal.engine.ValidatorImpl.isValidationRequired(ValidatorImpl.java:1257) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:459) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:406) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:370) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:322) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:625) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:490) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:331) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:152) ... Caused by: java.lang.NullPointerException at ch.voev.oevp.services.wegsuche.serviceobjects.WegAnfrage.hashCode(WegAnfrage.java:223) at org.hibernate.validator.internal.engine.resolver.SingleThreadCachedTraversableResolver$TraversableHolder.buildHashCode(SingleThreadCachedTraversableResolver.java:153) at org.hibernate.validator.internal.engine.resolver.SingleThreadCachedTraversableResolver$TraversableHolder.<init>(SingleThreadCachedTraversableResolver.java:114) at org.hibernate.validator.internal.engine.resolver.SingleThreadCachedTraversableResolver$TraversableHolder.<init>(SingleThreadCachedTraversableResolver.java:96) at org.hibernate.validator.internal.engine.resolver.SingleThreadCachedTraversableResolver.isReachable(SingleThreadCachedTraversableResolver.java:41) at org.hibernate.validator.internal.engine.ValidatorImpl.isValidationRequired(ValidatorImpl.java:1248){noformat} Problem is that {{Validator}} invokes {{hashCode()}} with {{null}} mandatory field. But purpose of validation is to check nullability of this field and produce a validation error. Current behavior is conceptually wrong from my point of view. Thanks in advance!
    via by oleg,
  • Steps to reproduce: 1. Go into user settings 2. Find a user and go to SSH keys tab 3. Try to paste in an SSH public key with a couple of spaces in the middle. 2014-08-13 10:20:41,501 ERROR [http-bio-7990-exec-4] @QB1BG0x620x117677x0 108aiad 95.175.4.101,127.0.0.1 "POST /mvc/error500 HTTP/1.1" c.a.s. i.web.ErrorPageController There was an unhandled exception loading [/stash/plugins/servlet/ssh/admin/users/zzz.xxxx/keys/add] javax.validation.ValidationException: HV000028: Unexpected exception during isValid call. at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:311) ~[hibernate-validator-4.3 .1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:180) ~[hibernate-validator-4.3.1.Fi nal.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:124) ~[hibernate-validator-4.3.1.Fi nal.jar:4.3.1.Final] at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:86) ~[hibernate-validator-4.3 .1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:442) ~[hibernate-validator-4.3.1.Final .jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:387) ~[hibernate-valid ator-4.3.1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:351) ~[hibernate-valid ator-4.3.1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:303) ~[hibernate-validator-4.3.1.Final. jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:133) ~[hibernate-validator-4.3.1.Final.jar:4.3.1 .Final] at org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:208) ~[spring-context-4. 0.5.RELEASE.jar:4.0.5.RELEASE] at com.atlassian.stash.util.ValidationUtils.validate(ValidationUtils.java:33) ~[stash-util-3.2.0.jar:na] at com.atlassian.stash.internal.key.ssh.DefaultSshKeyService.internalAddForUser(DefaultSshKeyService.java:293) ~[na:na] at com.atlassian.stash.internal.key.ssh.DefaultSshKeyService.addForUser(DefaultSshKeyService.java:78) ~[na:na] at com.atlassian.stash.internal.ssh.servlet.AddKeyRequestHandler.post(AddKeyRequestHandler.java:103) ~[na:na] at com.atlassian.stash.internal.ssh.servlet.SshKeysController.doPost(SshKeysController.java:111) ~[na:na] at com.atlassian.stash.internal.ssh.servlet.SshKeysController.service(SshKeysController.java:122) ~[na:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) ~[na:na] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:86) ~[StashAuthenti cationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthentic ationFilter.java:111) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:77 ) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:100) ~[atlassian- trusted-apps-core-3.0.6.jar:na] at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:69) ~[na:na] at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:33) ~[na:na] at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) ~[atlassian-core-4.6.15.jar:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthentica tionFilter.java:89) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75 ) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:84) ~[stash-service-impl-3.2.0.j ar:na] at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:446) ~[hazelcast-wm-3.3-RC2.jar:3.3-RC2] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_51] at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51] ... 209 frames trimmed Caused by: java.lang.RuntimeException: java.io.EOFException: Length to read: 257 actual: 146 at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.readBytes(KeyUtils.java:193) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.readBigInteger(KeyUtils.java:202) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.access$300(KeyUtils.java:175) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$RSAKeySpecDecoder.getSpec(KeyUtils.java:151) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$RSAKeySpecDecoder.getSpec(KeyUtils.java:141) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils.decodePublicKey(KeyUtils.java:111) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils.getPublicKey(KeyUtils.java:68) ~[na:na] at com.atlassian.stash.ssh.validation.PublicKeyValidator.isValid(PublicKeyValidator.java:19) ~[na:na] at com.atlassian.stash.ssh.validation.PublicKeyValidator.isValid(PublicKeyValidator.java:8) ~[na:na] at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:308) ~[hibernate-validator-4.3 .1.Final.jar:4.3.1.Final] ... 30 common frames omitted Caused by: java.io.EOFException: Length to read: 257 actual: 146 at org.apache.commons.io.IOUtils.readFully(IOUtils.java:2539) ~[commons-io-2.4.jar:2.4] at org.apache.commons.io.IOUtils.readFully(IOUtils.java:2558) ~[commons-io-2.4.jar:2.4] at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.readBytes(KeyUtils.java:189) ~[na:na] ... 39 common frames omitted
    via by Radosław Antoniuk,
  • I have the following validation rules defined in an interface: {code} @NotNull @DecimalMax(value= "90.0") @DecimalMin(value= "-90.0") Double getLatitude(); {code} In my tests, I also pass unexpected values such as {{Double.NAN}} or {{Double.POSITIVE_INFINITY}}. This triggers an exception: {noformat} javax.validation.ValidationException: HV000028: Unexpected exception during isValid call. at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateSingleConstraint(ConstraintTree.java:286) at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:133) at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:91) at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:83) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:547) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:487) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:451) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:403) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:206) {noformat} The exception is caused by the call to {{BigDecimal.valueOf(double val)}} in {{org.hibernate.validator.internal.constraintvalidators.bv.DecimalMaxValidatorForNumber}}, which throws an exception if val is infinite or NaN. The issue can be reproduced using the attached project.
    via by Xavier Sosnovsky,
  • Hello, I have mandatory field in object which I want to validate: {code} @NotNull private final LocalDate datumHinfahrt; {code} But when I'm trying to validate it using the Hibernate Validator I receive an exception: {noformat} javax.validation.ValidationException: HV000041: Call to TraversableResolver.isReachable() threw an exception. at org.hibernate.validator.internal.engine.ValidatorImpl.isValidationRequired(ValidatorImpl.java:1257) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:459) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:406) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:370) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:322) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:625) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:490) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:331) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:152) ... Caused by: java.lang.NullPointerException at ch.voev.oevp.services.wegsuche.serviceobjects.WegAnfrage.hashCode(WegAnfrage.java:223) at org.hibernate.validator.internal.engine.resolver.SingleThreadCachedTraversableResolver$TraversableHolder.buildHashCode(SingleThreadCachedTraversableResolver.java:153) at org.hibernate.validator.internal.engine.resolver.SingleThreadCachedTraversableResolver$TraversableHolder.<init>(SingleThreadCachedTraversableResolver.java:114) at org.hibernate.validator.internal.engine.resolver.SingleThreadCachedTraversableResolver$TraversableHolder.<init>(SingleThreadCachedTraversableResolver.java:96) at org.hibernate.validator.internal.engine.resolver.SingleThreadCachedTraversableResolver.isReachable(SingleThreadCachedTraversableResolver.java:41) at org.hibernate.validator.internal.engine.ValidatorImpl.isValidationRequired(ValidatorImpl.java:1248){noformat} Problem is that {{Validator}} invokes {{hashCode()}} with {{null}} mandatory field. But purpose of validation is to check nullability of this field and produce a validation error. Current behavior is conceptually wrong from my point of view. Thanks in advance!
    via by oleg,
  • Steps to reproduce: 1. Go into user settings 2. Find a user and go to SSH keys tab 3. Try to paste in an SSH public key with a couple of spaces in the middle. 2014-08-13 10:20:41,501 ERROR [http-bio-7990-exec-4] @QB1BG0x620x117677x0 108aiad 95.175.4.101,127.0.0.1 "POST /mvc/error500 HTTP/1.1" c.a.s. i.web.ErrorPageController There was an unhandled exception loading [/stash/plugins/servlet/ssh/admin/users/zzz.xxxx/keys/add] javax.validation.ValidationException: HV000028: Unexpected exception during isValid call. at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:311) ~[hibernate-validator-4.3 .1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:180) ~[hibernate-validator-4.3.1.Fi nal.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:124) ~[hibernate-validator-4.3.1.Fi nal.jar:4.3.1.Final] at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:86) ~[hibernate-validator-4.3 .1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:442) ~[hibernate-validator-4.3.1.Final .jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:387) ~[hibernate-valid ator-4.3.1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:351) ~[hibernate-valid ator-4.3.1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:303) ~[hibernate-validator-4.3.1.Final. jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:133) ~[hibernate-validator-4.3.1.Final.jar:4.3.1 .Final] at org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:208) ~[spring-context-4. 0.5.RELEASE.jar:4.0.5.RELEASE] at com.atlassian.stash.util.ValidationUtils.validate(ValidationUtils.java:33) ~[stash-util-3.2.0.jar:na] at com.atlassian.stash.internal.key.ssh.DefaultSshKeyService.internalAddForUser(DefaultSshKeyService.java:293) ~[na:na] at com.atlassian.stash.internal.key.ssh.DefaultSshKeyService.addForUser(DefaultSshKeyService.java:78) ~[na:na] at com.atlassian.stash.internal.ssh.servlet.AddKeyRequestHandler.post(AddKeyRequestHandler.java:103) ~[na:na] at com.atlassian.stash.internal.ssh.servlet.SshKeysController.doPost(SshKeysController.java:111) ~[na:na] at com.atlassian.stash.internal.ssh.servlet.SshKeysController.service(SshKeysController.java:122) ~[na:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) ~[na:na] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:86) ~[StashAuthenti cationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthentic ationFilter.java:111) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:77 ) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:100) ~[atlassian- trusted-apps-core-3.0.6.jar:na] at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:69) ~[na:na] at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:33) ~[na:na] at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) ~[atlassian-core-4.6.15.jar:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthentica tionFilter.java:89) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75 ) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:84) ~[stash-service-impl-3.2.0.j ar:na] at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:446) ~[hazelcast-wm-3.3-RC2.jar:3.3-RC2] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_51] at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51] ... 209 frames trimmed Caused by: java.lang.RuntimeException: java.io.EOFException: Length to read: 257 actual: 146 at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.readBytes(KeyUtils.java:193) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.readBigInteger(KeyUtils.java:202) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.access$300(KeyUtils.java:175) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$RSAKeySpecDecoder.getSpec(KeyUtils.java:151) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$RSAKeySpecDecoder.getSpec(KeyUtils.java:141) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils.decodePublicKey(KeyUtils.java:111) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils.getPublicKey(KeyUtils.java:68) ~[na:na] at com.atlassian.stash.ssh.validation.PublicKeyValidator.isValid(PublicKeyValidator.java:19) ~[na:na] at com.atlassian.stash.ssh.validation.PublicKeyValidator.isValid(PublicKeyValidator.java:8) ~[na:na] at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:308) ~[hibernate-validator-4.3 .1.Final.jar:4.3.1.Final] ... 30 common frames omitted Caused by: java.io.EOFException: Length to read: 257 actual: 146 at org.apache.commons.io.IOUtils.readFully(IOUtils.java:2539) ~[commons-io-2.4.jar:2.4] at org.apache.commons.io.IOUtils.readFully(IOUtils.java:2558) ~[commons-io-2.4.jar:2.4] at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.readBytes(KeyUtils.java:189) ~[na:na] ... 39 common frames omitted
    via by Radosław Antoniuk,
  • {{ConstraintDescriptorImpl.buildAnnotationParameterMap}} does not filter out sythetic methods. Resulting the following exception: {code} javax.validation.ValidationException: HV000083: The specified annotation defines no parameter '$jacocoInit'. at org.hibernate.validator.internal.util.privilegedactions.GetAnnotationParameter.run(GetAnnotationParameter.java:53) at org.hibernate.validator.internal.metadata.descriptor.ConstraintDescriptorImpl.run(ConstraintDescriptorImpl.java:741) at org.hibernate.validator.internal.metadata.descriptor.ConstraintDescriptorImpl.buildAnnotationParameterMap(ConstraintDescriptorImpl.java:562) at org.hibernate.validator.internal.metadata.descriptor.ConstraintDescriptorImpl.<init>(ConstraintDescriptorImpl.java:167) at org.hibernate.validator.internal.metadata.descriptor.ConstraintDescriptorImpl.<init>(ConstraintDescriptorImpl.java:211) at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.buildConstraintDescriptor(AnnotationMetaDataProvider.java:661) at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.findConstraintAnnotations(AnnotationMetaDataProvider.java:587) at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.findConstraints(AnnotationMetaDataProvider.java:532) at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.findExecutableMetaData(AnnotationMetaDataProvider.java:349) at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getMetaData(AnnotationMetaDataProvider.java:329) at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getMethodMetaData(AnnotationMetaDataProvider.java:315) at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.retrieveBeanConfiguration(AnnotationMetaDataProvider.java:138) at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getBeanConfiguration(AnnotationMetaDataProvider.java:125) at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getBeanConfigurationForHierarchy(AnnotationMetaDataProvider.java:108) at org.hibernate.validator.internal.metadata.BeanMetaDataManager.createBeanMetaData(BeanMetaDataManager.java:166) at org.hibernate.validator.internal.metadata.BeanMetaDataManager.getOrCreateBeanMetaData(BeanMetaDataManager.java:194) at org.hibernate.validator.internal.metadata.BeanMetaDataManager.getBeanMetaData(BeanMetaDataManager.java:142) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:783) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:681) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:416) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:795) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:681) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:416) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:795) at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:681) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:416) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:205) {code} Fix: {code} private Map<String, Object> buildAnnotationParameterMap(Annotation annotation) { final Method[] declaredMethods = run( GetDeclaredMethods.action( annotation.annotationType() ) ); Map<String, Object> parameters = newHashMap( declaredMethods.length ); for ( Method m : declaredMethods ) { //Add check for synthetic if(!m.isSynthetic()) { Object value = run( GetAnnotationParameter.action( annotation, m.getName(), Object.class ) ); parameters.put( m.getName(), value ); } } return Collections.unmodifiableMap( parameters ); } {code}
    via by Jeff Maxwell,
    • javax.validation.ValidationException: HV000187: When using type annotation constraints on parameterized iterables or map @Valid must be used. Check com.example.sample.app.register.RegisterForm#roles at org.hibernate.validator.internal.metadata.provider.TypeAnnotationAwareMetaDataProvider.findTypeArgumentsConstraints(TypeAnnotationAwareMetaDataProvider.java:114)[hibernate-validator-5.2.2.Final.jar:5.2.2.Final] at org.hibernate.validator.internal.metadata.provider.TypeAnnotationAwareMetaDataProvider.findTypeAnnotationConstraintsForMember(TypeAnnotationAwareMetaDataProvider.java:72)[hibernate-validator-5.2.2.Final.jar:5.2.2.Final] at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.findPropertyMetaData(AnnotationMetaDataProvider.java:243)[hibernate-validator-5.2.2.Final.jar:5.2.2.Final] at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getFieldMetaData(AnnotationMetaDataProvider.java:226)[hibernate-validator-5.2.2.Final.jar:5.2.2.Final] at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.retrieveBeanConfiguration(AnnotationMetaDataProvider.java:136)[hibernate-validator-5.2.2.Final.jar:5.2.2.Final] at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getBeanConfiguration(AnnotationMetaDataProvider.java:124)[hibernate-validator-5.2.2.Final.jar:5.2.2.Final] at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getBeanConfigurationForHierarchy(AnnotationMetaDataProvider.java:107)[hibernate-validator-5.2.2.Final.jar:5.2.2.Final] at org.hibernate.validator.internal.metadata.BeanMetaDataManager.createBeanMetaData(BeanMetaDataManager.java:163)[hibernate-validator-5.2.2.Final.jar:5.2.2.Final] at org.hibernate.validator.internal.metadata.BeanMetaDataManager.getOrCreateBeanMetaData(BeanMetaDataManager.java:191)[hibernate-validator-5.2.2.Final.jar:5.2.2.Final] at org.hibernate.validator.internal.metadata.BeanMetaDataManager.isConstrained(BeanMetaDataManager.java:135)[hibernate-validator-5.2.2.Final.jar:5.2.2.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:191)[hibernate-validator-5.2.2.Final.jar:5.2.2.Final] at org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:92)[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.validation.DataBinder.validate(DataBinder.java:869)[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.validateIfApplicable(ModelAttributeMethodProcessor.java:164)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.resolveArgument(ModelAttributeMethodProcessor.java:111)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:78)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:162)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:129)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:871)[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)[servlet-api.jar:na] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)[spring-webmvc-4.2.4.RELEASE.jar:4.2.4.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)[servlet-api.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)[catalina.jar:8.0.20.B] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)[catalina.jar:8.0.20.B] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)[tomcat-websocket.jar:8.0.20.B] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)[catalina.jar:8.0.20.B] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)[catalina.jar:8.0.20.B] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:122)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.terasoluna.gfw.web.logging.mdc.AbstractMDCPutFilter.doFilterInternal(AbstractMDCPutFilter.java:115)[terasoluna-gfw-web-5.1.0.RELEASE.jar:5.1.0.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:48)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:205)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:120)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:120)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:53)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176)[spring-security-web-4.0.3.RELEASE.jar:4.0.3.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)[catalina.jar:8.0.20.B] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)[catalina.jar:8.0.20.B] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)[catalina.jar:8.0.20.B] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)[catalina.jar:8.0.20.B] at org.terasoluna.gfw.web.logging.mdc.AbstractMDCPutFilter.doFilterInternal(AbstractMDCPutFilter.java:115)[terasoluna-gfw-web-5.1.0.RELEASE.jar:5.1.0.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)[catalina.jar:8.0.20.B] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)[catalina.jar:8.0.20.B] at org.terasoluna.gfw.web.exception.ExceptionLoggingFilter.doFilter(ExceptionLoggingFilter.java:99)[terasoluna-gfw-web-5.1.0.RELEASE.jar:5.1.0.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)[catalina.jar:8.0.20.B] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)[catalina.jar:8.0.20.B] at org.terasoluna.gfw.web.logging.mdc.MDCClearFilter.doFilterInternal(MDCClearFilter.java:50)[terasoluna-gfw-web-5.1.0.RELEASE.jar:5.1.0.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)[catalina.jar:8.0.20.B] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)[catalina.jar:8.0.20.B] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)[catalina.jar:8.0.20.B] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)[catalina.jar:8.0.20.B] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)[catalina.jar:8.0.20.B] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)[catalina.jar:8.0.20.B] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)[catalina.jar:8.0.20.B] at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)[catalina.jar:8.0.20.B] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)[catalina.jar:8.0.20.B] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)[catalina.jar:8.0.20.B] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1086)[tomcat-coyote.jar:8.0.20.B] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659)[tomcat-coyote.jar:8.0.20.B] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:147)[tomcat-coyote.jar:8.0.20.B] at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:279)[tomcat-coyote.jar:8.0.20.B] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)[na:1.8.0_101] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)[na:1.8.0_101] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)[tomcat-util.jar:8.0.20.B] at java.lang.Thread.run(Unknown Source)[na:1.8.0_101]

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,