Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5204

IllegalStateException when using custom URL handlers for bundles

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: framework-5.4.0
    • Fix Version/s: framework-5.6.0
    • Component/s: Framework
    • Labels:
      None

      Description

      The following exception can happen after having restarted the whole framework.

      java.lang.IllegalStateException: Stream handler unavailable.
      	at org.apache.felix.framework.URLHandlersStreamHandlerProxy.getDefaultPort(URLHandlersStreamHandlerProxy.java:180)
      	at java.net.URLStreamHandler.sameFile(URLStreamHandler.java:407)
      	at org.osgi.service.url.AbstractURLStreamHandlerService.sameFile(AbstractURLStreamHandlerService.java:131)
      	at java.net.URLStreamHandler.equals(URLStreamHandler.java:333)
      	at org.osgi.service.url.AbstractURLStreamHandlerService.equals(AbstractURLStreamHandlerService.java:81)
      	at org.apache.felix.framework.URLHandlersStreamHandlerProxy.equals(URLHandlersStreamHandlerProxy.java:163)
      	at java.net.URL.equals(URL.java:870)
      	at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:940)
      	at javax.crypto.JceSecurityManager.getCryptoPermission(JceSecurityManager.java:124)
      	at javax.crypto.Cipher.getConfiguredPermission(Cipher.java:2587)
      	at javax.crypto.Cipher.initCryptoPermission(Cipher.java:700)
      	at javax.crypto.Cipher.chooseProvider(Cipher.java:863)
      	at javax.crypto.Cipher.init(Cipher.java:1396)
      	at javax.crypto.Cipher.init(Cipher.java:1327)
      	at org.apache.sshd.common.cipher.BaseCipher.init(BaseCipher.java:60)
      	at org.apache.karaf.shell.ssh.SshUtils.buildCiphers(SshUtils.java:89)
      	at org.apache.karaf.shell.ssh.Activator.createSshServer(Activator.java:183)
      	at org.apache.karaf.shell.ssh.Activator.doStart(Activator.java:111)
      	at org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:233)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      

      The problems seems to be that the ProtectionDomain of the classes loaded from bundles do use the URL handler as their code source. This means that any access to those URL will throw IllegalStateException after the framework has been shutdown.
      The protection domain should use the url the jar from the filesystem for the code source url instead.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gnodet Guillaume Nodet
                Reporter:
                gnodet Guillaume Nodet
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: