Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of incorrect ServiceLoader causes runtime failures #1717

Open
michaeljfazio opened this issue May 4, 2020 · 0 comments
Open

Use of incorrect ServiceLoader causes runtime failures #1717

michaeljfazio opened this issue May 4, 2020 · 0 comments

Comments

@michaeljfazio
Copy link

michaeljfazio commented May 4, 2020

During initialisation of a Spark application, the following exception is thrown:

Caused by: java.lang.IllegalArgumentException: org.locationtech.geowave.core.store.data.field.FieldSerializationProviderSpi is not an ImageIO SPI class
        at java.desktop/javax.imageio.spi.ServiceRegistry.checkClassAllowed(ServiceRegistry.java:722)
        at java.desktop/javax.imageio.spi.ServiceRegistry.<init>(ServiceRegistry.java:117)
        at org.locationtech.geowave.core.index.SPIServiceRegistry.<init>(SPIServiceRegistry.java:42)
        at org.locationtech.geowave.core.store.data.field.FieldUtils.initRegistry(FieldUtils.java:47)
        at org.locationtech.geowave.core.store.data.field.FieldUtils.getRegisteredFieldReaders(FieldUtils.java:32)
        at org.locationtech.geowave.core.store.data.field.FieldUtils.getDefaultReaderForClass(FieldUtils.java:81)
        at org.locationtech.geowave.core.store.query.options.CommonQueryOptions$HintKey.init(CommonQueryOptions.java:42)
        at org.locationtech.geowave.core.store.query.options.CommonQueryOptions$HintKey.<init>(CommonQueryOptions.java:38)
        at org.locationtech.geowave.core.store.util.DataStoreUtils.<clinit>(DataStoreUtils.java:99)

The issue manifests itself because of changes made in the JDK version 9 and above that explicitly forbid use of the ImageIO service loader for loading non ImageIO SPI classes. The class org.locationtech.geowave.core.index.SPIServiceRegistry.java directly extends the ImageIO service loader. It should java.util.ServiceLoader

See:

https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8068749

Using JDK version 8 and below are a workaround, although not a practical one in our current environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant