Re: [netcdf-java] NoClassDefFoundError in NetcdfFile.canOpen(String)

Hi Martin-

My bad. I've make a fix and it will be in the next release. We'll also update the docs because visadNoDods.jar is required for reading McIDAS grids and GEMPAK files as well. Thanks for catching this.

Don


Martin Desruisseaux wrote:
Hello all

I'm using the NetCDF library version 4.1 without the visadNoDods.jar file (this dependency is big! 4.3Mb). In my understanding of

http://www.unidata.ucar.edu/software/netcdf-java/reference/JarDependencies.html

this dependency is optional if I don't need to read McIDAS AREA files. This work well for normal NetCDF I/O operations. But when trying to invoke the following code:

   NetcdfFile.canOpen("myFile")

on any file that is not a NetCDF file (for example a PNG image), I get the following exception:

    java.lang.NoClassDefFoundError: visad/util/Trace
       at ucar.nc2.iosp.gempack.GempackStationFileIOSP.isValidFile:141
       (...snip...)
       at ucar.nc2.NetcdfFile.canOpen(NetcdfFile.java:412)

I can workaround with a try ... catch block. But is there any chance to have NetcdfFile.canOpen(...) to not check file format that depends on optional JAR files not present on the classpath?

    Regards,

        Martin

_______________________________________________
netcdf-java mailing list
netcdf-java@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/

--
*************************************************************
Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************



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