Unidata / netcdf-java

The Unidata netcdf-java library
https://docs.unidata.ucar.edu/netcdf-java/current/userguide/index.html
BSD 3-Clause "New" or "Revised" License
146 stars 71 forks source link

[5.5.3]: NetCDF files can't be opened #1198

Closed FlorianFehring closed 1 year ago

FlorianFehring commented 1 year ago

Versions impacted by the bug

v5.x

What went wrong?

Triing to open netCDF files for Leaf Area Index from https://land.copernicus.vgt.vito.be/PDF/portal/Application.html#Browse;Root=512260;Collection=1000062;DoSearch=true;Time=NORMAL,NORMAL,1,JANUARY,2014,12,JUNE,2023;ROI=6.6282565130259,47.164327625282,15.398296593186,54.604207384801;isReserved=false with the base sample code:

NetcdfFile file = NetcdfFiles.open(filepath);
reader = new NetCDFReader(file);

Throw null pointer exception.

Relevant stack trace

java.lang.NullPointerException: Cannot invoke "String.trim()" because "location" is null
    at ucar.nc2.NetcdfFiles.getRaf(NetcdfFiles.java:403)
    at ucar.nc2.NetcdfFiles.open(NetcdfFiles.java:274)
    at ucar.nc2.NetcdfFiles.open(NetcdfFiles.java:243)
    at ucar.nc2.NetcdfFiles.open(NetcdfFiles.java:216)

Relevant log messages

No response

If you have an example file that you can share, please attach it to this issue.

If so, may we include it in our test datasets to help ensure the bug does not return once fixed? Note: the test datasets are publicly accessible without restriction.

No

Code of Conduct

FlorianFehring commented 1 year ago

My fault, misinterpreted the error message. Just filepath is missing.