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.
Greetings Pierre, Which version of netcdf-java are you using, and have you successfully installed the netCDF-C library? https://www.unidata.ucar.edu/software/thredds/current/netcdf-java/reference/netcdf4Clibrary.html If yes, are you using the latest released version of the C library? Cheers, Sean On Tue, Jul 19, 2016 at 3:17 AM, Lacoste Pierre (DAVIDSON) <PLacoste@xxxxxx> wrote: > Hello, > > > > I try to use the Netcdf-java to create a netcdf4 file. > > I tried the example > https://www.unidata.ucar.edu/software/netcdf/examples/programs/Sfc_pres_temp_wr.java > and It’s well running. > > But I need to generate a netcdf4 and the example is in netcdf3. So, I > change the line > > “dataFile = > NetcdfFileWriter.createNew(NetcdfFileWriter.Version.netcdf3, filename);” > > By > > “dataFile = NetcdfFileWriter.createNew(NetcdfFileWriter.Version.netcdf4, > filename);” > > > > But when I execute the test, I got the following error: > > > > Exception in thread "main" java.lang.NullPointerException > > at ucar.nc2.jni.netcdf.Nc4Iosp.flush(Nc4Iosp.java:3270) > > at > ucar.nc2.NetcdfFileWriter.rewrite(NetcdfFileWriter.java:842) > > at > ucar.nc2.NetcdfFileWriter.setRedefineMode(NetcdfFileWriter.java:832) > > at > ucar.nc2.NetcdfFileWriter.close(NetcdfFileWriter.java:1019) > > at > com.tests.Sfc_pres_temp_wr.main(Sfc_pres_temp_wr.java:131) > > > > Could you tell me how can I solve this problem? > > > > Thank for your help, > > > > Pierre > ------------------------------ > > *Ce message et toutes les pièces jointes (ci-après le "message") sont > établis à l'intention exclusive de ses destinataires et sont confidentiels. > Si vous recevez ce message par erreur ou s'il ne vous est pas destiné, > merci de le détruire ainsi que toute copie de votre système et d'en avertir > immédiatement l'expéditeur. Toute lecture non autorisée, toute utilisation > de ce message qui n'est pas conforme à sa destination, toute diffusion ou > toute publication, totale ou partielle, est interdite. L'Internet ne > permettant pas d'assurer l'intégrité de ce message électronique susceptible > d'altération, l’expéditeur (et ses filiales) décline(nt) toute > responsabilité au titre de ce message dans l'hypothèse où il aurait été > modifié ou falsifié.* > > *This message and any attachments (the "message") is intended solely for > the intended recipient(s) and is confidential. If you receive this message > in error, or are not the intended recipient(s), please delete it and any > copies from your systems and immediately notify the sender. Any > unauthorized view, use that does not comply with its purpose, dissemination > or disclosure, either whole or partial, is prohibited. Since the internet > cannot guarantee the integrity of this message which may not be reliable, > the sender (and its subsidiaries) shall not be liable for the message if > modified or falsified. * > > _______________________________________________ > 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: > http://www.unidata.ucar.edu/mailing_lists/ >
netcdf-java
archives: