MINA
  1. MINA
  2. DIRMINA-659

AccessControlException when running MINA in a Applet: RuntimePermission "modifyThread"

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M4
    • Fix Version/s: 2.0.0-RC1
    • Labels:
      None
    • Environment:
      Java 5 Applet (using appletviewer)

      Description

      I'm using MINA 2.0.0-M4 within a restricted environment (an Applet in my case, could also be JNLP).

      When running the code in appletviewer, I need to add a permission for the code to be executed successfully:
      permission java.lang.RuntimePermission "modifyThread";

      If I don't add this permission, the code fails with the following stack trace:

      Exception in thread "pool-2-thread-1" java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread)
      at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
      at java.security.AccessController.checkPermission(AccessController.java:427)
      at java.util.concurrent.ThreadPoolExecutor.shutdown(ThreadPoolExecutor.java:893)
      at org.apache.mina.core.service.SimpleIoProcessorPool.dispose(SimpleIoProcessorPool.java:230)
      at org.apache.mina.core.polling.AbstractPollingIoConnector$Connector.run(AbstractPollingIoConnector.java:512)
      at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:65)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
      at java.lang.Thread.run(Thread.java:613)

      The exception occurs when I close the SocketConnector:

      public synchronized void close()
      {
      if (connector != null)

      { connector.dispose(); connector = null; }

      }

        Activity

        Jeff Mesnil created issue -
        Edouard De Oliveira made changes -
        Field Original Value New Value
        Assignee Edouard De Oliveira [ ted_kods ]
        Edouard De Oliveira made changes -
        Issue Type Bug [ 1 ] Task [ 3 ]
        Fix Version/s 2.0.0-M7 [ 12313995 ]
        Component/s Web Site / Documentation [ 12311381 ]
        Edouard De Oliveira made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Julien Vermillard made changes -
        Fix Version/s 2.0.0-RC1 [ 12313865 ]
        Fix Version/s 2.0.0-M7 [ 12313995 ]

          People

          • Assignee:
            Edouard De Oliveira
            Reporter:
            Jeff Mesnil
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development