[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: netcdf-java 2.2.10 problem





Bob Simons wrote:
Thank you for your quick response.

John Caron wrote:

i assume you are using ncCore.jar?


No. I'm using netcdf-2.2.10.jar. The download page says it just reads netcdf 3 files but I needed to write them, too. And I am interested (eventually) in netcdf 4.


It appears I introduced a dependency on NetcdfFileCache that i forgot to include in the jar.


But NetcdfFileCache.class (and some inner classes) are in netcdf-2.2.10.jar ...


This isnt a problem if you use the full netcdf.jar. If you need the smaller jar, i will fix the problem.


It's sounds like I'm using the "right" jar. So which jar should I use?


You should use netcdf-2.2.10.jar, which as you say has the NetcdfFileCache in 
it. so why arent you seeing it?
usually these things are classpath problems. put netcdf-2.2.10.jar first to see 
if that solves it. If it does, track down what other jar file in your classpath 
is interfering.

if not, its probably a class loader problem. but lets not go there yet.

BTW, sorry for the lack of documentation on transitioning from 2.1 -> 2.2. Ive 
gotten so used to it, I forget what has to be done.




Bob Simons wrote:

I am trying to switch from Netcdf-java 2.1 to Netcdf-java 2.2.10.
I have gotten everything switched over (grumble, grumble, a little documentation about how to handle things that have changed would be nice... although maybe I just didn't find it, :-) ), except for NCdump.print and its variants. Whenever I call it, I get the error message:

Exception in thread "main" java.lang.NoClassDefFoundError
        at ucar.nc2.NCdump.print(NCdump.java:191)
        at ucar.nc2.NCdump.printHeader(NCdump.java:54)
        at <my code>

Line 191 in the source code you distribute is
          NetcdfFileCache.release(nc);

Usually, these problems are solvable. But this time, I am at a loss as to how to solve the problem. It isn't an "import" problem in my code or a -cp problem on my compiler command line, because my code compiles correctly. It isn't a -cp problem on the java command line, because my running code clearly finds NCdump. It isn't that NetcdfFileCache.class isn't in the .jar you distribute (I checked; it's there).

I looked at the list of changes for 2.2.11, but didn't see anything that looked relevant.

I didn't find any unit test methods in the source code which would demonstrate this class working correctly. (Maybe they are there and I didn't find them.)

Any suggestions?

Sincerely,

Bob Simons
Satellite Data Product Manager
Environmental Research Division
NOAA Southwest Fisheries Science Center
1352 Lighthouse Ave
Pacific Grove, CA 93950-2079
(831)658-3205
address@hidden
<>< <>< <>< <>< <>< <>< <>< <>< <><


Sincerely,

Bob Simons
Satellite Data Product Manager
Environmental Research Division
NOAA Southwest Fisheries Science Center
1352 Lighthouse Ave
Pacific Grove, CA 93950-2079
(831)658-3205
address@hidden
<>< <>< <>< <>< <>< <>< <>< <>< <><