Skip to content

Error in ServiceProviderExtensionFinder #5

@jchappelle

Description

@jchappelle

I'm now experimenting with packaging my application as a zip file and deploying into the plugins folder. When I first did it I noticed my extensions all had two instances. It occurred to me that I needed to remove the META-INF/services files since now I'm using the @extension annotation. When I removed the entire META-INF/services folder I got an exception. So I decided to leave the META-INF/services folder but have it empty. Still the same exception.

I was able to fix it by making my Application class implement PluginManagerFactory and create my plugin manager like so:

    @Override
    public PluginManager createPluginManager(File pluginsDir)
    {
        return new DefaultPluginManager()
        {
            @Override
            protected ExtensionFinder createExtensionFinder()
            {
                return new LegacyExtensionFinder(this);
            }
        };
    }

Here is the exception I got. Am I doing something wrong or is this a bug? Not a huge deal since there is a work around but I did want to make you aware since it may expose a bigger problem.

java.lang.IllegalArgumentException: URI is not hierarchical
     at java.io.File.<init>(Unknown Source)
     at ro.fortsoft.pf4j.ServiceProviderExtensionFinder.readPluginsStorages(ServiceProviderExtensionFinder.java:119)
     at ro.fortsoft.pf4j.AbstractExtensionFinder.readStorages(AbstractExtensionFinder.java:124)
     at ro.fortsoft.pf4j.AbstractExtensionFinder.getEntries(AbstractExtensionFinder.java:131)
     at ro.fortsoft.pf4j.AbstractExtensionFinder.find(AbstractExtensionFinder.java:49)
     at ro.fortsoft.pf4j.DefaultExtensionFinder.find(DefaultExtensionFinder.java:41)
     at ro.fortsoft.pf4j.DefaultPluginManager.getExtensions(DefaultPluginManager.java:555)

Also, when I refreshed the page with a CTRL-F5 I got this exception. Figured this may give you more info into the problem. This was before I implemented the custom PluginManagerFactory.

java.nio.file.FileSystemAlreadyExistsException
     at com.sun.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:113)
     at java.nio.file.FileSystems.newFileSystem(Unknown Source)
     at java.nio.file.FileSystems.newFileSystem(Unknown Source)
     at ro.fortsoft.pf4j.ServiceProviderExtensionFinder.readClasspathStorages(ServiceProviderExtensionFinder.java:70)
     at ro.fortsoft.pf4j.AbstractExtensionFinder.readStorages(AbstractExtensionFinder.java:123)
     at ro.fortsoft.pf4j.AbstractExtensionFinder.getEntries(AbstractExtensionFinder.java:131)
     at ro.fortsoft.pf4j.AbstractExtensionFinder.find(AbstractExtensionFinder.java:49)
     at ro.fortsoft.pf4j.DefaultExtensionFinder.find(DefaultExtensionFinder.java:41)
     at ro.fortsoft.pf4j.DefaultPluginManager.getExtensions(DefaultPluginManager.java:555)

I'm using the wicket-plugin version 0.5.0.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions