OpenJPA
  1. OpenJPA
  2. OPENJPA-1206

Bean validation call to provider not Java 2 Enabled

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M2, 2.0.0
    • Fix Version/s: 2.0.0-M3
    • Component/s: validation
    • Labels:
      None

      Description

      With Java 2 security enabled, Bean validation processing caused following security violation exception.

      java.security.AccessControlException: Access denied (java.lang.RuntimePermission accessDeclaredMembers)
      at java.security.AccessController.checkPermission(AccessController.java:108)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
      at com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:211)
      at java.lang.SecurityManager.checkMemberAccess(SecurityManager.java:1664)
      at java.lang.Class.checkMemberAccess(Class.java:109)
      at java.lang.Class.getDeclaredMethods(Class.java:673)
      ......... BV provider call path........
      at org.apache.openjpa.persistence.validation.ValidatorImpl.validate(ValidatorImpl.java:289)
      at org.apache.openjpa.validation.ValidatingLifecycleEventManager.fireEvent(ValidatingLifecycleEventManager.java:122)
      at org.apache.openjpa.kernel.BrokerImpl.fireLifecycleEvent(BrokerImpl.java:788)
      at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2538)
      at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2390)
      at org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:1039)
      at org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:692)

      Albert Lee.

        Activity

        Hide
        Albert Lee added a comment -

        Encountered another code path that requires doPriv.

        java.lang.ExceptionInInitializerError
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:222)
        ..... provider code path......
        at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:45)
        at org.apache.openjpa.persistence.validation.ValidatorImpl.getDefaultValidatorFactory(ValidatorImpl.java:395)
        at org.apache.openjpa.persistence.validation.ValidatorImpl.initialize(ValidatorImpl.java:130)
        at org.apache.openjpa.persistence.validation.ValidatorImpl.<init>(ValidatorImpl.java:102)
        at org.apache.openjpa.persistence.validation.ValidationUtils.setupValidation(ValidationUtils.java:99)
        at org.apache.openjpa.persistence.PersistenceProviderImpl.loadValidator(PersistenceProviderImpl.java:270)
        at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:181)
        at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:63)
        at com.ibm.ws.jpa.management.JPAPUnitInfo.createEMFactory(JPAPUnitInfo.java:1561)
        at com.ibm.ws.jpa.management.JPAPUnitInfo.createEntityManagerFactory(JPAPUnitInfo.java:1333)
        at com.ibm.ws.jpa.management.JPAPxmlInfo.extractPersistenceUnits(JPAPxmlInfo.java:490)
        at com.ibm.ws.jpa.management.JPAScopeInfo.processPersistenceUnit(JPAScopeInfo.java:140)
        at com.ibm.ws.jpa.management.JPAApplInfo.processModulePUs(JPAApplInfo.java:169)
        at com.ibm.ws.jpa.management.JPAComponentImpl.startingDeployedModule(JPAComponentImpl.java:878)
        at com.ibm.ws.jpa.management.JPAComponentImpl.stateChanged(JPAComponentImpl.java:722)
        at com.ibm.ws.runtime.component.ApplicationMgrImpl.stateChanged(ApplicationMgrImpl.java:1072)
        at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectEvent(DeployedApplicationImpl.java:1296)
        at com.ibm.ws.runtime.component.DeployedModuleImpl.setState(DeployedModuleImpl.java:216)
        at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:616)
        at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:938)
        at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:723)
        at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2044)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:437)
        at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:122)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:380)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$300(CompositionUnitMgrImpl.java:108)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:935)
        at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:349)
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1554)
        Caused by: java.security.AccessControlException: Access denied (java.lang.RuntimePermission createClassLoader)
        at java.security.AccessController.checkPermission(AccessController.java:108)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
        at com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:212)
        at java.lang.SecurityManager.checkCreateClassLoader(SecurityManager.java:594)
        at java.lang.ClassLoader.<init>(ClassLoader.java:143)
        at java.lang.ClassLoader.<init>(ClassLoader.java:124)
        ..... provider code path......
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
        ... 32 more

        Show
        Albert Lee added a comment - Encountered another code path that requires doPriv. java.lang.ExceptionInInitializerError at java.lang.J9VMInternals.initialize(J9VMInternals.java:222) ..... provider code path...... at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:45) at org.apache.openjpa.persistence.validation.ValidatorImpl.getDefaultValidatorFactory(ValidatorImpl.java:395) at org.apache.openjpa.persistence.validation.ValidatorImpl.initialize(ValidatorImpl.java:130) at org.apache.openjpa.persistence.validation.ValidatorImpl.<init>(ValidatorImpl.java:102) at org.apache.openjpa.persistence.validation.ValidationUtils.setupValidation(ValidationUtils.java:99) at org.apache.openjpa.persistence.PersistenceProviderImpl.loadValidator(PersistenceProviderImpl.java:270) at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:181) at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:63) at com.ibm.ws.jpa.management.JPAPUnitInfo.createEMFactory(JPAPUnitInfo.java:1561) at com.ibm.ws.jpa.management.JPAPUnitInfo.createEntityManagerFactory(JPAPUnitInfo.java:1333) at com.ibm.ws.jpa.management.JPAPxmlInfo.extractPersistenceUnits(JPAPxmlInfo.java:490) at com.ibm.ws.jpa.management.JPAScopeInfo.processPersistenceUnit(JPAScopeInfo.java:140) at com.ibm.ws.jpa.management.JPAApplInfo.processModulePUs(JPAApplInfo.java:169) at com.ibm.ws.jpa.management.JPAComponentImpl.startingDeployedModule(JPAComponentImpl.java:878) at com.ibm.ws.jpa.management.JPAComponentImpl.stateChanged(JPAComponentImpl.java:722) at com.ibm.ws.runtime.component.ApplicationMgrImpl.stateChanged(ApplicationMgrImpl.java:1072) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectEvent(DeployedApplicationImpl.java:1296) at com.ibm.ws.runtime.component.DeployedModuleImpl.setState(DeployedModuleImpl.java:216) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:616) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:938) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:723) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2044) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:437) at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:122) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:380) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$300(CompositionUnitMgrImpl.java:108) at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:935) at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:349) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1554) Caused by: java.security.AccessControlException: Access denied (java.lang.RuntimePermission createClassLoader) at java.security.AccessController.checkPermission(AccessController.java:108) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:212) at java.lang.SecurityManager.checkCreateClassLoader(SecurityManager.java:594) at java.lang.ClassLoader.<init>(ClassLoader.java:143) at java.lang.ClassLoader.<init>(ClassLoader.java:124) ..... provider code path...... at java.lang.J9VMInternals.initializeImpl(Native Method) at java.lang.J9VMInternals.initialize(J9VMInternals.java:200) ... 32 more
        Hide
        Albert Lee added a comment -

        Changes are committed under svn r799155 and r799013.

        Due to incorrect comment prefix (i.e. OENJPA-1206), these changes are not being logged in this JIRA's "committed version" history.

        Show
        Albert Lee added a comment - Changes are committed under svn r799155 and r799013. Due to incorrect comment prefix (i.e. OENJPA-1206), these changes are not being logged in this JIRA's "committed version" history.

          People

          • Assignee:
            Albert Lee
            Reporter:
            Albert Lee
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development