[netcdf-java] NullPointerException while parsing hdf5 header

  • To: "netcdf-java@xxxxxxxxxxxxxxxx" <netcdf-java@xxxxxxxxxxxxxxxx>
  • Subject: [netcdf-java] NullPointerException while parsing hdf5 header
  • From: David Kegley <kegs@xxxxxx>
  • Date: Fri, 12 Mar 2021 16:02:37 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=b23.io; dmarc=pass action=none header.from=b23.io; dkim=pass header.d=b23.io; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Kt1WF6pcAKKvuxw0rjyKGUTANbRl7rgiDcx8gHdF9q4=; b=Yql2yClGPAc1pStK7IEa0WuX6Yd8Zpi+GxKx0wG1d43RQZCaBD2vhOstEq/k6VlKT03CHx1ndj5/5TFBBkaiuzG+ZoBC2fGDWtn8QsxdGzh9k35ca1pYUiIyXS/XXkuqmjpIdr3tLxXIyXO82NJn1Pj5kp035kVQ+zWA2A/wg4IEqLM3Rpf3gzMeC3i6CjAjg/ENnQdizQytoJPptlal6TfUmIvGvjUn/Wz0GN0oHNOFI3q18U114x7racK8mCoB7GxgBW5EQcv2BJp6SjcjY/tiP9Ak1M0X1DLVXokltYCmSSYlahx++IPA09JTv9jEgyClJ3zRjCiR4WAKa4ImkQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oqz+scPIKF/LmdTdjnbJaGoxnFFwJUn18CdAnFmzkTJ6YJH4+PqHmnuPrFNI0T5WHnVK0BEs0Da8vzyvIkjlD8O7LYXVNXwtPJmxPwbxK1rKfDOUudccqQxxA1+Gqnz4a7MXM7T2V2RcmRyDLfxASmEzoJro1hIDfrhIzIQS1liDdf8TEXnecLUVlf8x4MXAg1qZM52LqEf6PLTB3j67fy/Ufi9ekic7w6W9eLVZdSjcE3Z8gA799mqnZF+cJU9lAEfUNIi96eUbNJBwGP7Ha2IaYrrQQ/wOFmcMpgrE1CGIAUJetFAkYqKQYZ8GjOnY64V0o7g3C0KAt9N4nDZUdQ==
  • Authentication-results: unidata.ucar.edu; dkim=none (message not signed) header.d=none; unidata.ucar.edu; dmarc=none action=none header.from=b23.io;
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



  • 2021 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: