OpenJPA
  1. OpenJPA
  2. OPENJPA-339

Java 2 security Access denied in File.toURL() call

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.7
    • Fix Version/s: 1.0.1, 1.1.0
    • Component/s: lib
    • Labels:
      None

      Description

      Encounter the following access denial exception when Java 2 security is enabled in application server environment.

      File.toURL() is not documented which requires security check, however indirectly, the File.isDirectory() is invoked, which required security permission.

      Exception = java.security.AccessControlException
      Source = com.ibm.ws.security.core.SecurityManager
      probeid = 180
      Stack Dump = java.security.AccessControlException: Access denied (java.io.FilePermission C:\WAS3\profiles\AppSrv01\installedApps\javajoeNode01Cell\EJB3JPACallbackBeanApp.ear\EJB3JPACallbackWebApp.war\WEB-INF\classes\suite\r70\base\jpaspec\callback\entities\AbstractCallbackEntity.class read)
      at java.security.AccessController.checkPermission(AccessController.java:104)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:547)
      at com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:189)
      at java.lang.SecurityManager.checkRead(SecurityManager.java:886)
      at java.io.File.isDirectory(File.java:747)
      at java.io.File.toURL(File.java:620)
      at org.apache.openjpa.lib.meta.FileMetaDataIterator.next(FileMetaDataIterator.java:114)
      at org.apache.openjpa.lib.meta.ClassArgParser.mapTypeNames(ClassArgParser.java:283)
      at org.apache.openjpa.meta.AbstractCFMetaDataFactory.scan(AbstractCFMetaDataFactory.java:778)
      at org.apache.openjpa.meta.AbstractCFMetaDataFactory.parsePersistentTypeNames(AbstractCFMetaDataFactory.java:637)
      at org.apache.openjpa.meta.AbstractCFMetaDataFactory.getPersistentTypeNames(AbstractCFMetaDataFactory.java:605)
      at org.apache.openjpa.meta.MetaDataRepository.getPersistentTypeNames(MetaDataRepository.java:1214)
      at org.apache.openjpa.meta.MetaDataRepository.loadPersistentTypes(MetaDataRepository.java:1231)
      at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:245)
      at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:197)
      at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
      at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:190)
      at com.ibm.ws.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:37)
      at com.ibm.ws.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:28)

      1. OPENJPA-339.patch
        10 kB
        Albert Lee
      2. OPENJPA-339.1.patch
        5 kB
        Albert Lee

        Activity

        Albert Lee created issue -
        Kevin Sutter made changes -
        Field Original Value New Value
        Assignee Albert Lee [ allee8285 ]
        Kevin Sutter made changes -
        Fix Version/s 1.0.0 [ 12312341 ]
        Albert Lee made changes -
        Attachment OPENJPA-339.patch [ 12364641 ]
        Kevin Sutter made changes -
        Resolution Fixed [ 1 ]
        Fix Version/s 1.1.0 [ 12312344 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Albert Lee made changes -
        Status Resolved [ 5 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Albert Lee made changes -
        Attachment OPENJPA-339.1.patch [ 12364894 ]
        Kevin Sutter made changes -
        Resolution Fixed [ 1 ]
        Status Reopened [ 4 ] Resolved [ 5 ]
        Michael Dick made changes -
        Fix Version/s 1.0.1 [ 12312687 ]
        Albert Lee made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development