javax.validation.ValidationException: HV000041: Call to TraversableResolver.isReachable() threw an exception.

Hibernate JIRA | Ivo Studensky | 1 year ago
  1. 0

    PersistenceUtilHelper calls clazz.getDeclaredField/Method without doPrivileged(). Because of this, deployments in EE needs to have RuntimePermission("accessDeclaredMembers") when using Hibernate Validator and running with Security Manager enabled. It would be nice if getDeclaredField/Method calling can be done inside of doPrivileged() block. I am not sure if the component assigned to this Jira is correct. PersistenceUtilHelper is located at Hibernate EntityManager, but I hit this issue through Hibernate Validator used by a deployment in WildFly server, see the following stacktrace: {noformat} javax.validation.ValidationException: HV000041: Call to TraversableResolver.isReachable() threw an exception. at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:273) at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:175) at java.lang.Class.checkMemberAccess(Class.java:2348) at java.lang.Class.getDeclaredField(Class.java:2067) at org.hibernate.jpa.internal.util.PersistenceUtilHelper$ClassMetadataCache.buildAttributeAccess(PersistenceUtilHelper.java:348) at org.hibernate.jpa.internal.util.PersistenceUtilHelper$ClassMetadataCache.getAttributeAccess(PersistenceUtilHelper.java:339) at org.hibernate.jpa.internal.util.PersistenceUtilHelper.isLoadedWithReference(PersistenceUtilHelper.java:202) at org.hibernate.jpa.HibernatePersistenceProvider$1.isLoadedWithReference(HibernatePersistenceProvider.java:175) at javax.persistence.Persistence$1.isLoaded(Persistence.java:116) at org.hibernate.validator.internal.engine.resolver.JPATraversableResolver.isReachable(JPATraversableResolver.java:46) at org.hibernate.validator.internal.engine.resolver.DefaultTraversableResolver.isReachable(DefaultTraversableResolver.java:128) at org.hibernate.validator.internal.engine.resolver.CachingTraversableResolverForSingleValidation.isReachable(CachingTraversableResolverForSingleValidation.java:36) at org.hibernate.validator.internal.engine.ValidatorImpl.isReachable(ValidatorImpl.java:1522) at org.hibernate.validator.internal.engine.ValidatorImpl.isValidationRequired(ValidatorImpl.java:1507) at org.hibernate.validator.internal.engine.ValidatorImpl.validateMetaConstraint(ValidatorImpl.java:584) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:555) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:490) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:454) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:406) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:204) at org.jboss.as.test.integration.beanvalidation.hibernate.validator.MessageInterpolationValidationTestCase.testCustomMessageInterpolation(MessageInterpolationValidationTestCase.java:56) {noformat}

    Hibernate JIRA | 1 year ago | Ivo Studensky
    javax.validation.ValidationException: HV000041: Call to TraversableResolver.isReachable() threw an exception.
  2. 0

    PersistenceUtilHelper calls clazz.getDeclaredField/Method without doPrivileged(). Because of this, deployments in EE needs to have RuntimePermission("accessDeclaredMembers") when using Hibernate Validator and running with Security Manager enabled. It would be nice if getDeclaredField/Method calling can be done inside of doPrivileged() block. I am not sure if the component assigned to this Jira is correct. PersistenceUtilHelper is located at Hibernate EntityManager, but I hit this issue through Hibernate Validator used by a deployment in WildFly server, see the following stacktrace: {noformat} javax.validation.ValidationException: HV000041: Call to TraversableResolver.isReachable() threw an exception. at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:273) at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:175) at java.lang.Class.checkMemberAccess(Class.java:2348) at java.lang.Class.getDeclaredField(Class.java:2067) at org.hibernate.jpa.internal.util.PersistenceUtilHelper$ClassMetadataCache.buildAttributeAccess(PersistenceUtilHelper.java:348) at org.hibernate.jpa.internal.util.PersistenceUtilHelper$ClassMetadataCache.getAttributeAccess(PersistenceUtilHelper.java:339) at org.hibernate.jpa.internal.util.PersistenceUtilHelper.isLoadedWithReference(PersistenceUtilHelper.java:202) at org.hibernate.jpa.HibernatePersistenceProvider$1.isLoadedWithReference(HibernatePersistenceProvider.java:175) at javax.persistence.Persistence$1.isLoaded(Persistence.java:116) at org.hibernate.validator.internal.engine.resolver.JPATraversableResolver.isReachable(JPATraversableResolver.java:46) at org.hibernate.validator.internal.engine.resolver.DefaultTraversableResolver.isReachable(DefaultTraversableResolver.java:128) at org.hibernate.validator.internal.engine.resolver.CachingTraversableResolverForSingleValidation.isReachable(CachingTraversableResolverForSingleValidation.java:36) at org.hibernate.validator.internal.engine.ValidatorImpl.isReachable(ValidatorImpl.java:1522) at org.hibernate.validator.internal.engine.ValidatorImpl.isValidationRequired(ValidatorImpl.java:1507) at org.hibernate.validator.internal.engine.ValidatorImpl.validateMetaConstraint(ValidatorImpl.java:584) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:555) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:490) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:454) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:406) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:204) at org.jboss.as.test.integration.beanvalidation.hibernate.validator.MessageInterpolationValidationTestCase.testCustomMessageInterpolation(MessageInterpolationValidationTestCase.java:56) {noformat}

    Hibernate JIRA | 1 year ago | Ivo Studensky
    javax.validation.ValidationException: HV000041: Call to TraversableResolver.isReachable() threw an exception.
  3. 0

    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!

    Hibernate JIRA | 1 year ago | oleg
    javax.validation.ValidationException: HV000041: Call to TraversableResolver.isReachable() threw an exception.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Not able to embed 1.7-rc2 in a springboot application - JPA provider issue

    Google Groups | 3 years ago | Laurent Quérel
    javax.validation.ValidationException: HV000041: Call to TraversableResolver.isReachable() threw an exception.
  6. 0

    Not able to embed 1.7-rc2 in a springboot application - JPA provider issue

    Google Groups | 3 years ago | Laurent Quérel
    javax.validation.ValidationException: HV000041: Call to TraversableResolver.isReachable() threw an exception.

    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.ValidationException

      HV000041: Call to TraversableResolver.isReachable() threw an exception.

      at org.wildfly.security.manager.WildFlySecurityManager.checkPermission()
    2. WildFly Security Manager
      WildFlySecurityManager.checkPermission
      1. org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:273)
      2. org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:175)
      2 frames
    3. Java RT
      Class.getDeclaredField
      1. java.lang.Class.checkMemberAccess(Class.java:2348)
      2. java.lang.Class.getDeclaredField(Class.java:2067)
      2 frames
    4. org.hibernate.jpa
      HibernatePersistenceProvider$1.isLoadedWithReference
      1. org.hibernate.jpa.internal.util.PersistenceUtilHelper$ClassMetadataCache.buildAttributeAccess(PersistenceUtilHelper.java:348)
      2. org.hibernate.jpa.internal.util.PersistenceUtilHelper$ClassMetadataCache.getAttributeAccess(PersistenceUtilHelper.java:339)
      3. org.hibernate.jpa.internal.util.PersistenceUtilHelper.isLoadedWithReference(PersistenceUtilHelper.java:202)
      4. org.hibernate.jpa.HibernatePersistenceProvider$1.isLoadedWithReference(HibernatePersistenceProvider.java:175)
      4 frames
    5. JavaEE 7
      Persistence$1.isLoaded
      1. javax.persistence.Persistence$1.isLoaded(Persistence.java:116)
      1 frame
    6. Hibernate Validator Engine
      ValidatorImpl.validate
      1. org.hibernate.validator.internal.engine.resolver.JPATraversableResolver.isReachable(JPATraversableResolver.java:46)
      2. org.hibernate.validator.internal.engine.resolver.DefaultTraversableResolver.isReachable(DefaultTraversableResolver.java:128)
      3. org.hibernate.validator.internal.engine.resolver.CachingTraversableResolverForSingleValidation.isReachable(CachingTraversableResolverForSingleValidation.java:36)
      4. org.hibernate.validator.internal.engine.ValidatorImpl.isReachable(ValidatorImpl.java:1522)
      5. org.hibernate.validator.internal.engine.ValidatorImpl.isValidationRequired(ValidatorImpl.java:1507)
      6. org.hibernate.validator.internal.engine.ValidatorImpl.validateMetaConstraint(ValidatorImpl.java:584)
      7. org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:555)
      8. org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:490)
      9. org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:454)
      10. org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:406)
      11. org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:204)
      11 frames
    7. org.jboss.as
      MessageInterpolationValidationTestCase.testCustomMessageInterpolation
      1. org.jboss.as.test.integration.beanvalidation.hibernate.validator.MessageInterpolationValidationTestCase.testCustomMessageInterpolation(MessageInterpolationValidationTestCase.java:56)
      1 frame