Snappy HDF5 error

Using the snappy python module (Ubuntu 14.04, python 2.7) I can’t load any files with
fid = home + ‘S1A_IW_GRDH_1SDV_20151105T052456_20151105T052521_008465_00BF7A_AD04.zip’
product = ProductIO.readProduct(fid)

I get this error:
java.lang.UnsatisfiedLinkError: no jhdf5 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at ncsa.hdf.hdf5lib.H5.loadH5Lib(H5.java:339)
at ncsa.hdf.hdf5lib.H5.(H5.java:266)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.esa.snap.dataio.hdf5.Hdf5ProductWriterPlugIn.loadHdf5Lib(Hdf5ProductWriterPlugIn.java:144)
at org.esa.snap.dataio.hdf5.Hdf5ProductWriterPlugIn.(Hdf5ProductWriterPlugIn.java:45)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at org.esa.snap.SnapCoreActivator.loadServices(SnapCoreActivator.java:60)
at org.esa.snap.core.dataio.ProductIOPlugInManager.(ProductIOPlugInManager.java:195)
at org.esa.snap.core.dataio.ProductIOPlugInManager$Holder.(ProductIOPlugInManager.java:201)
at org.esa.snap.core.dataio.ProductIOPlugInManager.getInstance(ProductIOPlugInManager.java:45)
at org.esa.snap.core.dataio.ProductIO.getProductReaderForInput(ProductIO.java:252)
at org.esa.snap.core.dataio.ProductIO.readProductImpl(ProductIO.java:211)
at org.esa.snap.core.dataio.ProductIO.readProduct(ProductIO.java:183)
WARNING: org.esa.snap.dataio.hdf5.Hdf5ProductWriterPlugIn: class org.esa.snap.dataio.hdf5.Hdf5ProductWriterPlugIn: HDF-5 library not available: class java.lang.UnsatisfiedLinkError: ncsa.hdf.hdf5lib.H5.H5dont_atexit()I

However, the JHDF5 file is definitely there in the SNAP install. Is there some setting in snappy.ini or otherwise that has to be updated to track down the java binding?

Thanks!

Actually I would think that you can ignore this error message. The product should be read anyway.
The message just means that the HDF5 writer is not available and you don’t need it for S1 product.
If the product is not read there might be another problem. Try to unpack the zip and use the ‘manifest.safe’ file as input.

regards
Marco

I’m getting the same thing reading an S1 product. It works for me on OS X, but installed everything on Ubuntu and can’t seem to read any files now. I use apt-get install to install libjhdf5 and I can see the file in /usr/lib/jni/. So not sure what else is needed - it’s there just not seeing it.
-CS

I’m also getting the same error under Ubuntu 16.04 and it seems that I also have proper HDF-5 libraries (libjhdf5-jni and libjhdf5-java)
I use following code for testing (I’m trying to open three kinds of Sentinel-1 products):

import sys
from snappy import ProductIO

file="S1A_IW_GRDH_1SDV_20160509T043538_20160509T043603_011177_010E0F_2700.zip"
print('\nTrying to open Sentinel-1 GRDH file\n')
product = ProductIO.readProduct(file)
product.getDescription()

file="S1A_IW_RAW__0SDV_20160509T043535_20160509T043607_011177_010E0F_1B7C.zip"
print('\nLet me try to open Sentinel-1 RAW file\n')
product = ProductIO.readProduct(file)
product.getDescription()

file="S1A_IW_SLC__1SDV_20160505T161903_20160505T161931_011126_010C5E_9954.zip"
print('\nMaybe Sentinel-1 SLC file will works properly?\n') 
product = ProductIO.readProduct(file)
product.getDescription()

which produces following output:

Trying to open Sentinel-1 GRDH file

java.lang.UnsatisfiedLinkError: no jhdf5 in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at ncsa.hdf.hdf5lib.H5.loadH5Lib(H5.java:339)
    at ncsa.hdf.hdf5lib.H5.<clinit>(H5.java:266)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at org.esa.s3tbx.dataio.probav.ProbaVSynthesisProductReaderPlugIn.loadClassWithNativeDependencies(ProbaVSynthesisProductReaderPlugIn.java:140)
    at org.esa.s3tbx.dataio.probav.ProbaVSynthesisProductReaderPlugIn.loadHdf5Lib(ProbaVSynthesisProductReaderPlugIn.java:130)
    at org.esa.s3tbx.dataio.probav.ProbaVSynthesisProductReaderPlugIn.<clinit>(ProbaVSynthesisProductReaderPlugIn.java:35)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at java.lang.Class.newInstance(Class.java:442)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at org.esa.snap.SnapCoreActivator.loadServices(SnapCoreActivator.java:60)
    at org.esa.snap.core.dataio.ProductIOPlugInManager.<init>(ProductIOPlugInManager.java:194)
    at org.esa.snap.core.dataio.ProductIOPlugInManager$Holder.<clinit>(ProductIOPlugInManager.java:201)
    at org.esa.snap.core.dataio.ProductIOPlugInManager.getInstance(ProductIOPlugInManager.java:45)
    at org.esa.snap.core.dataio.ProductIO.getProductReaderForInput(ProductIO.java:252)
    at org.esa.snap.core.dataio.ProductIO.readProductImpl(ProductIO.java:211)
    at org.esa.snap.core.dataio.ProductIO.readProduct(ProductIO.java:183)
WARNING: org.esa.s3tbx.dataio.probav.ProbaVSynthesisProductReaderPlugIn: class org.esa.s3tbx.dataio.probav.ProbaVSynthesisProductReaderPlugIn: HDF-5 library not available: class java.lang.UnsatisfiedLinkError: ncsa.hdf.hdf5lib.H5.H5dont_atexit()I
WARNING: org.esa.snap.dataio.hdf5.Hdf5ProductWriterPlugIn: class org.esa.snap.dataio.hdf5.Hdf5ProductWriterPlugIn: HDF-5 library not available: class java.lang.NoClassDefFoundError: Could not initialize class ncsa.hdf.hdf5lib.H5

Let me try to open Sentinel-1 RAW file

Sentinel1Level0Reader.readXMLSchema: IOException /media/mateuszk/Nowy/Dane z Sentinela/S1A_IW_RAW__0SDV_20160509T043535_20160509T043607_011177_010E0F_1B7C.zip/support/s1-level-0-annot.xsd (Nie jest katalogiem)
Sentinel1Level0Reader.readXMLSchema: IOException /media/mateuszk/Nowy/Dane z Sentinela/S1A_IW_RAW__0SDV_20160509T043535_20160509T043607_011177_010E0F_1B7C.zip/support/s1-level-0-index.xsd (Nie jest katalogiem)
Sentinel1Level0Reader.createBinaryReader: IOException Invalid input file providedexists: false
isDirectory: false

Sentinel1Level0Reader.createBinaryReader: IOException Invalid input file providedexists: false
isDirectory: false

Sentinel1Level0Reader.createBinaryReader: IOException Invalid input file providedexists: false
isDirectory: false

Sentinel1Level0Reader.createBinaryReader: IOException Invalid input file providedexists: false
isDirectory: false


Maybe Sentinel-1 SLC file will works properly?

EDIT: Seems that creating symbolic links resolves issue with reading Sentinel-1 GRDH:

SNAP_HOME=~/snap
cd $SNAP_HOME/snap/modules/lib/x86_64
ln -s …/amd64/libjhdf.so
ln -s …/amd64/libjhdf5.so

4 Likes