{"action":"opened","issue":{"url":"https://api.github.com/repos/decebals/pf4j/issues/96","repository_url":"https://api.github.com/repos/decebals/pf4j","labels_url":"https://api.github.com/repos/decebals/pf4j/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/decebals/pf4j/issues/96/comments","events_url":"https://api.github.com/repos/decebals/pf4j/issues/96/events","html_url":"https://github.com/decebals/pf4j/issues/96","id":142053673,"number":96,"title":"java.nio.file.FileSystemAlreadyExistsException","user":{"login":"tarkal","id":7042623,"avatar_url":"https://avatars.githubusercontent.com/u/7042623?v=3","gravatar_id":"","url":"https://api.github.com/users/tarkal","html_url":"https://github.com/tarkal","followers_url":"https://api.github.com/users/tarkal/followers","following_url":"https://api.github.com/users/tarkal/following{/other_user}","gists_url":"https://api.github.com/users/tarkal/gists{/gist_id}","starred_url":"https://api.github.com/users/tarkal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarkal/subscriptions","organizations_url":"https://api.github.com/users/tarkal/orgs","repos_url":"https://api.github.com/users/tarkal/repos","events_url":"https://api.github.com/users/tarkal/events{/privacy}","received_events_url":"https://api.github.com/users/tarkal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-19T11:28:44Z","updated_at":"2016-03-19T11:28:44Z","closed_at":null,"body":"I have the following method that I am using to invoke a specific extension from a specific plugin:\r\n\r\n```\r\npublic DispatchServices invokeDispatcher(Plugin plugin, Extension extension) throws MissingResourceException{\r\n\r\n        PluginInvoker invoker = (plugin1, extension1) -> {\r\n\r\n            // Load the plugins\r\n            File userPluginFile = new File(AppConfig.getInstance().getUserPluginDir(plugin1.getOwner().getId()));\r\n            PluginManager pluginManager = new DefaultPluginManager(userPluginFile);\r\n            pluginManager.loadPlugins();\r\n\r\n            if (plugin1.getStatus().equals(Plugin.State.ACTIVE)) pluginManager.startPlugin(plugin1.getName());\r\n\r\n            List<DispatchServices> extensions = pluginManager.getExtensions(DispatchServices.class);\r\n            for (DispatchServices ext : extensions) {\r\n                if (ext.getClass().getName().equals(extension1.getImplementation())) {\r\n                    return ext;\r\n                }\r\n            }\r\n            throw new MissingResourceException(\"Could not invoke plugin extension.\", plugin1.getName(), extension1.getName());\r\n        };\r\n\r\n        return (DispatchServices) invoker.invoke(plugin, extension);\r\n    }\r\n```\r\n\r\nThe first time this method is called everything works perfectly. However, subsequent calls to the method generate the following exception:\r\n\r\n```\r\nCaused by: java.nio.file.FileSystemAlreadyExistsException: null\r\n\tat com.sun.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:113) ~[zipfs.jar:1.8.0]\r\n\tat java.nio.file.FileSystems.newFileSystem(FileSystems.java:326) ~[na:1.8.0]\r\n\tat java.nio.file.FileSystems.newFileSystem(FileSystems.java:276) ~[na:1.8.0]\r\n\tat ro.fortsoft.pf4j.ServiceProviderExtensionFinder.readClasspathStorages(ServiceProviderExtensionFinder.java:70) ~[pf4j-0.12.0.jar:0.12.0]\r\n\tat ro.fortsoft.pf4j.AbstractExtensionFinder.readStorages(AbstractExtensionFinder.java:123) ~[pf4j-0.12.0.jar:0.12.0]\r\n\tat ro.fortsoft.pf4j.AbstractExtensionFinder.getEntries(AbstractExtensionFinder.java:131) ~[pf4j-0.12.0.jar:0.12.0]\r\n\tat ro.fortsoft.pf4j.AbstractExtensionFinder.find(AbstractExtensionFinder.java:49) ~[pf4j-0.12.0.jar:0.12.0]\r\n\tat ro.fortsoft.pf4j.DefaultExtensionFinder.find(DefaultExtensionFinder.java:41) ~[pf4j-0.12.0.jar:0.12.0]\r\n\tat ro.fortsoft.pf4j.DefaultPluginManager.getExtensions(DefaultPluginManager.java:555) ~[pf4j-0.12.0.jar:0.12.0]\r\n\tat co.ff36.halo.core.plugin.invoker.LocalPluginInvoker.lambda$invokeDispatcher$3(LocalPluginInvoker.java:55) ~[classes/:na]\r\n\tat co.ff36.halo.core.plugin.invoker.LocalPluginInvoker$$Lambda$4/1765003256.invoke(Unknown Source) ~[na:na]\r\n\tat co.ff36.halo.core.plugin.invoker.LocalPluginInvoker.invokeDispatcher(LocalPluginInvoker.java:66) ~[classes/:na]\r\n\tat co.ff36.halo.core.resource.server.impl.DispatcherProtocolsServerResource.represent(DispatcherProtocolsServerResource.java:55) ~[classes/:na]\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0]\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0]\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0]\r\n\tat java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0]\r\n\tat org.restlet.resource.ServerResource.doHandle(ServerResource.java:523) ~[org.restlet-2.3.6.jar:na]\r\n\t... 51 common frames omitted\r\n```\r\n\r\nUnfortunately the stack is not overly useful in diagnosing the problem."}}