Harmony
  1. Harmony
  2. HARMONY-6475

[classlib][nio] - Selector.open() throw AccessControlException when SecurityManager is installed

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0M13
    • Fix Version/s: 5.0M15
    • Component/s: Classlib
    • Labels:
      None

      Description

      test:
      SecurityManager manager = new SecurityManager();
      System.setSecurityManager(manager);
      Selector selector = Selector.open();

      got error:

      Uncaught exception in main:
      java.lang.ExceptionInInitializerError
      at java.lang.ClassLoader.getResources(ClassLoader.java:236)
      at java.nio.channels.spi.SelectorProvider.loadProviderByJar(SelectorProvider.java:120)
      at java.nio.channels.spi.SelectorProvider.provider(SelectorProvider.java:93)
      at java.nio.channels.Selector.open(Selector.java:48)
      at Test.main(Test.java:138)
      Caused by: java.security.AccessControlException: Permission check failed (java.util.PropertyPermission vm.boot.class.path read)
      at java.security.AccessControlContext.checkPermission(AccessControlContext.java:132)
      at java.security.AccessController.checkPermission(AccessController.java:194)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:862)
      at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:450)
      at java.lang.System.getProperty(System.java:159)
      at java.lang.ClassLoader$BootstrapLoader.<clinit>(ClassLoader.java:758)
      at java.lang.ClassLoader.getResources(ClassLoader.java:236)
      ... 4 more

        Activity

          People

          • Assignee:
            Regis Xu
            Reporter:
            Regis Xu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development