NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
Hi All, I’m attempting to parse a HDF5 file using the netcdf-java library and I’m getting the following NullPointer exception while parsing the file header. [main] WARN ucar.nc2.iosp.hdf5.H5header - HDF5 file /tmp/data.h5 not handling hdf integer type (0) with size= 16 java.io.IOException: java.lang.NullPointerException at ucar.nc2.NetcdfFile.open(NetcdfFile.java:384) at ucar.nc2.NetcdfFile.open(NetcdfFile.java:343) at ucar.nc2.NetcdfFile.open(NetcdfFile.java:326) at ucar.nc2.NetcdfFile.open(NetcdfFile.java:312) at gov.noaa.pfel.coastwatch.griddata.NcHelper.openFile(NcHelper.java:712) at gov.noaa.pfel.coastwatch.griddata.NcHelper.ncdump(NcHelper.java:104) at gov.noaa.pfel.erddap.dataset.EDDTableFromMultidimNcFiles.generateDatasetsXml(EDDTableFromMultidimNcFiles.java:228) at gov.noaa.pfel.erddap.GenerateDatasetsXml.doIt(GenerateDatasetsXml.java:656) at gov.noaa.pfel.erddap.GenerateDatasetsXml.main(GenerateDatasetsXml.java:974) Caused by: java.lang.NullPointerException at ucar.nc2.iosp.hdf5.H5header.readAttributeData(H5header.java:1154) at ucar.nc2.iosp.hdf5.H5header.makeAttribute(H5header.java:1002) at ucar.nc2.iosp.hdf5.H5header.makeAttributes(H5header.java:978) at ucar.nc2.iosp.hdf5.H5header.makeNetcdfGroup(H5header.java:562) at ucar.nc2.iosp.hdf5.H5header.makeNetcdfGroup(H5header.java:488) at ucar.nc2.iosp.hdf5.H5header.read(H5header.java:197) at ucar.nc2.iosp.hdf5.H5iosp.open(H5iosp.java:108) at ucar.nc2.NetcdfFile.<init>(NetcdfFile.java:1590) at ucar.nc2.NetcdfFile.open(NetcdfFile.java:782) at ucar.nc2.NetcdfFile.open(NetcdfFile.java:381) ... 8 more The version info from my netcdf-java jar manifest: Manifest-Version: 1.0 Implementation-Title: CDM core library Implementation-Version: 5.3.3 Built-By: ubuntu Implementation-Vendor-Id: edu.ucar Implementation-URL: https://docs.unidata.ucar.edu/thredds/netcdf-java/ 5.3/userguide/index.html Created-By: Gradle 3.5.1 Build-Jdk: 1.8.0_161 Built-On: 2020-06-17T05:48:56+0000 Implementation-Vendor: UCAR/Unidata Main-Class: ucar.nc2.NCdumpW Additional background: I’m using the ERDDAP toolkit (https://github.com/BobSimons/erddap/tree/v2.11) which utilizes this library, so I’m not calling these methods directly myself. ERDDAP docker image: axiom/docker-erddap:2.11 The same hdf5 file can be parsed successfully using h5ls: $ h5ls -frv /tmp/data.h5 Opened "/tmp/data.h5" with sec2 driver. … Any thoughts on this would be very helpful. I’m not very familiar with this library so if I’m overlooking any relevant details for debugging then please let me know. Unfortunately I cannot share the hdf5 file itself or its schema Thanks! David
netcdf-java
archives: