[geotk] Migration to OpenJDK 11

Martin Desruisseaux martin.desruisseaux at geomatys.com
Thu Jan 31 03:48:30 PST 2019


Hello Christoph

Le 31/01/2019 à 12:21, Christoph Steinforth a écrit :

> we are working on an application which uses geotk in the version 3.20.
> Whilst there is no problem using OpenJDK 8 to start the application,
> Java 11 gives us the follwing stack trace:
>
>     (…snip…)
>
>     4056/0|18-12-07 10:07:39|Caused by:
>     java.lang.IllegalArgumentException: org.opengis.util.NameFactory
>     is not an ImageIO SPI class
>
>     (…snip…)
>
> Is there any work around this with geotk 3.20?
>
I'm not aware of a way that would not require modification of source
code. The current code uses the JDK class
javax.imageio.spi.ServiceRegistry for managing factories. That class was
compatible with java.util.ServiceLoader but with more functionalities
(in particular the capability to set precedence between factories). But
since Jigsaw in Java 9, java.util.ServiceLoader has evolved to become
the only "official" mechanism for managing services in a modularized
world. The JDK added a restriction on javax.imageio.spi.ServiceRegistry
presumably for inciting developers to migrate to java.util.ServiceLoader.

The fix is to replace all our use of javax.imageio.spi.ServiceRegistry
by java.util.ServiceLoader in source code. We have not done yet this
work. Alternatively, can you share which Geotk functionalities you use?
If those functionalities are available in Apache SIS, the migration may
possibly be mostly a matter of changing package names.

    Martin


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geotoolkit/attachments/20190131/6b7e8506/attachment.html>


More information about the Geotoolkit mailing list