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

Hibernate JIRA | Ivo Studensky | 1 year ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  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.

    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