Java exception when importing esa_snappy

It took me a lot of time even managing to run the Snappy configuration (incl. having to install jpy which is not even listed in the documentation) on my headless setup (see this thread). I was happy after getting configuration successful.

My happiness was cut short once I tried importing the esa_snappy module:

Error while parsing JAI registry file "file:/storage/shared/gis/snap/snap/modules/org.esa.snap.snap-gpf/org-jaitools/jt-vectorize.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #4
A descriptor is already registered against the name "Vectorize" under registry mode "rendered"
Error while parsing JAI registry file "file:/storage/shared/gis/snap/snap/modules/ext/org.esa.snap.snap-core/org-geotools/gt-coverage.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #31
A descriptor is already registered against the name "org.geotools.ColorReduction" under registry mode "rendered"
Error in registry file at line number #32
A descriptor is already registered against the name "org.geotools.ColorInversion" under registry mode "rendered"
Error while parsing JAI registry file "file:/storage/shared/gis/snap/snap/modules/ext/org.esa.snap.snap-core/org-jaitools/jt-zonalstats.jar!/META-INF/registryFile.jai" :
Error in registry file at line number #4
A descriptor is already registered against the name "ZonalStats" under registry mode "rendered"
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.

I am using the latest stable SNAP with the latest esa-snappy PyPl package, installed on a Python 3.12.0 (also tried 3.10.0) via pip.

@dolaf could yo take a look ?

Thank you!

Whoever encounters these issues I recommend simply skipping on ESA Snappy and calling GPT directly as a subprocess since that works without any issues.

Hello alat,

could you please provide the full stack trace of the Java exception you are referring to in the title of your post?

In general, for installation and usage of esa_snappy, please follow the latest instructions given here. In any case, it is no longer required to install jpy manually. All you need should be included in the PyPi esa_snappy package.

If you still observe issues, please describe in detail if possible. Then we can try to sort out step by step.

Thanks a lot,
Olaf