Re: [netcdf-java] NullPointerException while parsing hdf5 header

  • To: John Caron <jcaron1129@xxxxxxxxx>
  • Subject: Re: [netcdf-java] NullPointerException while parsing hdf5 header
  • From: David Kegley <kegs@xxxxxx>
  • Date: Fri, 19 Mar 2021 19:03:42 +0000
  • Arc-authentication-results: i=1; 1; spf=pass; dmarc=pass action=none; dkim=pass; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed;; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=loCZn16GSBWrjpLUIbZoSfY87CZCjpXuP4hx7mwlENk=; b=kNJYEq/liT6nm6qbZF4qI8GQjg0D8DyucPLV4ffVDKVDALxjh7QcOSoUSawfj6QjmLAmYy9yb2bCx8dRGuCEZ/9+WrwRQN5e9d0RlkwlWs7H02PFt9q+DWOPo6PtaSRjeuGVvqHYFhX1wJk6+QnDKQ27Dl7x/Sew1Rb0jzjH62bIgjhw7EmIE1aYBpkxdB1b4FqzGK7Ct1hl62/JEDyRNuv7jmY6ex2p11JKN4cvNSdmPLbHhd7YjnaXWSFRSPmo8ZIu4oG/ymPDJigQpJVz8csY7H7Wa/fRwFHWS+3BUZN6ou7QYgNkMPs6BKJXe6LgO1NqDw1AOeuAFItljp2Euw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901;; cv=none; b=NfF2RQdeqxvyNX8JQPMBBzTK5lXIB8WmnP0rbC7D1ECM7ALyCyJbULwiz4IbOw7xeIFPSsHei3PYlfecrv33SlZy4+rWQ3P1LgM1hUW7YfwEC6OXq7Delswcf2O4VQmQjC1q8zRqUsgDa65vHpCSFpAST0vRWfFFyDWtgc8X6dPEqUYEC0BaFQ0HB3T51HnjxRMcNOgHVI/4hoFFXw2V1SL9n92/ZQNLhVWbpKMq4cxGL2w1sA/MYdKf+d7V7W1vbIuEZXpfUhLfW1xyveEI3rC45djdStOkqFpIjHyjpYBE6RYigh9ieV4fhNkGz6e6gSNnXJgwlmU9clAaniB50Q==
  • Authentication-results:; dkim=none (message not signed) header.d=none;; dmarc=none action=none;
Thank you, John! Turns out there was a UUID attribute being stored as a 128-bit 
integer that was causing problems. I was able to move past that error by 
re-writing the file without the UUID attr for now.

From: John Caron <jcaron1129@xxxxxxxxx>
Date: Friday, March 12, 2021 at 10:23 PM
To: David Kegley <kegs@xxxxxx>
Cc: "netcdf-java@xxxxxxxxxxxxxxxx" <netcdf-java@xxxxxxxxxxxxxxxx>
Subject: Re: [netcdf-java] NullPointerException while parsing hdf5 header

On the face of it, you have a file with a 16 byte integer type, which is not 
supported in Java.

On Fri, Mar 12, 2021 at 9:02 AM David Kegley <kegs@xxxxxx<mailto:kegs@xxxxxx>> 
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.lang.NullPointerException
 at gov.noaa.pfel.coastwatch.griddata.NcHelper.openFile(
 at gov.noaa.pfel.coastwatch.griddata.NcHelper.ncdump(
 at gov.noaa.pfel.erddap.GenerateDatasetsXml.doIt(
 at gov.noaa.pfel.erddap.GenerateDatasetsXml.main(
Caused by: java.lang.NullPointerException
 at ucar.nc2.iosp.hdf5.H5header.readAttributeData(
 at ucar.nc2.iosp.hdf5.H5header.makeAttribute(
 at ucar.nc2.iosp.hdf5.H5header.makeAttributes(
 at ucar.nc2.iosp.hdf5.H5header.makeNetcdfGroup(
 at ucar.nc2.iosp.hdf5.H5header.makeNetcdfGroup(
 at ucar.nc2.NetcdfFile.<init>(
 ... 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
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 ( 
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


NOTE: All exchanges posted to Unidata maintained email lists are
recorded in the Unidata inquiry tracking system and made publicly
available through the web.  Users who post to any of the lists we
maintain are reminded to remove any personal information that they
do not want to be made public.

netcdf-java mailing list
For list information or to unsubscribe, visit:
  • 2021 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: