Open jacobwentzib opened 2 weeks ago
Shuffle
filter.NetCDF-java's FilterProviders.
Here is the full trace:
java.io.IOException: ucar.nc2.filter.UnknownFilterException: Unknown filter: no filter found with id 2
at ucar.nc2.internal.iosp.hdf5.H5tiledLayoutBB.
Thanks for sending that. I am not aware of any changes between version 5.5.3 and 5.6.0 that may have caused this issue. And I am not yet able to reproduce this behavior. Just to be sure I am testing the same situation:
cdm-core-5.6.0.jar
?jar tf cdm-core-5.6.0.jar | grep META-INF/services/ucar.nc2.filter.FilterProvider
Filter
implemented similar to the example here and registered via a META-INF/services/ucar.nc2.filter.FilterProvider
file?Thanks for checking that. I don't know how it's possible that your cdm-core-5.6.0.jar
is missing those filters. Are you getting your artifacts from our artifacts server: https://artifacts.unidata.ucar.edu/repository/unidata-all/? Can you try replacing that dependency? For instance, by downloading it manually from here?
the pom.xml:
<properties>
<edu.ucar.version>5.6.0</edu.ucar.version>
</properties>
...
<dependency>
<groupId>edu.ucar</groupId>
<artifactId>cdm-core</artifactId>
<version>${edu.ucar.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
...
<repositories>
<repository>
<id>unidata-all</id>
<name>Unidata All</name>
<url>https://artifacts.unidata.ucar.edu/repository/unidata-all/</url>
</repository>
<repository>
<id>ucar-unidata</id>
<url>https://repo.osgeo.org/repository/release/</url>
</repository>
<repositories>
Expanding the jar I see the services in the META-INF of the cdm-core jar.
It seems like the SPI is not working when bundled. As mentioned previously this works when ran in IDE with all jars on class path but when we create our jar it gets these issues where it cannot find the Filters.
We do not want to shade our jar to navigate around this.
Bump on this.
Versions impacted by the bug
5.6.0 - Latest
Environment: UCAR Library Version: cdm-core 5.6.0 Java Version: 21
What went wrong?
Recently upgraded to 5.6.0 and see the following exception being thrown where the ServiceLoader is unable to load Filters properly.
https://github.com/Unidata/netcdf-java/blob/42186c77b9d424aeb45e333be80593c7a03c608e/cdm/core/src/main/java/ucar/nc2/filter/Filters.java#L80
Once we downgrade back to 5.5.3 everything works properly.
Has there been any changes to classpath or anything else that could be causes this issue? We are seeing this isolated to jar executions but IDE development with target classes runs properly.
We have created a custom ServiceLoader within our application and can see the resources being found.
Relevant stack trace
Being invoked from: Variable.class:
Error throw from above link: java.io.IOException: ucar.nc2.filter.UnknownFilterException: Unknown filter: no filter found with id 2
Relevant log messages
No response
If you have an example file that you can share, please attach it to this issue.
If so, may we include it in our test datasets to help ensure the bug does not return once fixed? Note: the test datasets are publicly accessible without restriction.
Yes
Code of Conduct