Skip to content

importCommands using globs does not with with Java9 #469

@hossman

Description

@hossman

the "importCommands" parsing code for dealing with prefix based globs (ie: org.kitesdk.** or com.foo.morphlines.*) Doesn't work using Java9.

This seems to be because the underlying classpath scanning is build on the ClassPath.from(ClassLoader) API shadded from Guava, which has a very notable limitation documented...

* <p>Currently only {@link URLClassLoader} and only {@code file://} urls are supported.

...but in Java9, URLClassLoader is (aparently) rarely used as a result of the new (jigsaw) module system.

The only work around seems to be to change all morphlines configs to remove * globs from importCommands declarations and enumate every CommandBuilder implemenation needed for the config.

I suggest morphlines switch to using SPI based scanning for CommandBuilders since that is a good API for plugins that has been supported by the JVM for a looooong time, and continues to work in Java9.

See also: https://issues.apache.org/jira/browse/SOLR-8876

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