Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-2271

Hibernate Validator test-cases fails due to missing accessDeclaredMembers RuntimePermission

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.0.ER4
    • 7.0.0.ER1
    • JPA/Hibernate
    • None

      Hibernate Validator test-cases calling a validator from an in-container class (e.g. a test-class deployed to the server by Arquillian) need RuntimePermission("accessDeclaredMembers") in order to pass.

      It is a question if it should be handled by a doPrivileged block in Hibernate Validator project or if the affected test-cases need to be provided by additional permissions.

      Here is the stack-trace of one of the affected tests:

      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)
      

      Tests affected by this are located at org.jboss.as.test.integration.beanvalidation.hibernate.validator package.

              istudens@redhat.com Ivo Studensky
              istudens@redhat.com Ivo Studensky
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: