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

  • To: David Kegley <kegs@xxxxxx>
  • Subject: Re: [netcdf-java] NullPointerException while parsing hdf5 header
  • From: John Caron <jcaron1129@xxxxxxxxx>
  • Date: Mon, 22 Mar 2021 11:17:19 -0600
cool. You could add it back as a 16 byte array. In Java, it could be turned
into a BigInteger.

On Fri, Mar 19, 2021 at 1:03 PM David Kegley <kegs@xxxxxx> wrote:

> 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> wrote:
>
> 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
>
>
>
>
>
>
>
> _______________________________________________
> 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
> netcdf-java@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe, visit:
> https://www.unidata.ucar.edu/mailing_lists/
>
>
  • 2021 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: