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

[netCDFJava #AYO-259890]: Malformed URL and .dds appended to URL



Hi Jo Ellen:

in openNetcdfGridDataset, the URL

 
file:/C:/VERDI_test/VERDI_1.5.1_test03092015/data/model/CCTM46_P16.baseO2a.36k.O3MAX

is converted to

 /C:/VERDI_test/VERDI_1.5.1_test03092015/data/model/CCTM46_P16.baseO2a.36k.O3MAX

which passes 

  NetcdfFile.open()

but fails on 

 GridDataset.open(urlString)


I would suggest that you remove the part that strips ofd "file" but leaves the 
leading "/". Basically 
dont use 

  urlString = new URI(urlString).getPath();

I will also check if we should be accepting the leading "/", but that will take 
a while.

        private GridDataset openNetcdfGridDataset(URL url) throws 
URISyntaxException, IOException {
                Logger.debug("in NetcdfDatasetFactory.openNetcdfGridDataset, 
url = " + url);
                String urlString = url.toExternalForm();
                Logger.debug("when converted .toExternalForm(), urlString = " + 
urlString);
                
                if (url.getProtocol().equals("file")) {
                        Logger.debug("url.getProtocol().equals('file') so ready 
to get updated urlString");
                        urlString = new URI(urlString).getPath();
                        Logger.debug("updated urlString = " + urlString);
                }
                
                validNetcdfFile( urlString);
                Logger.debug("back from validNetcdfFile");

                // return GridDataset.open(urlString); // NetCDF ENHANCE
                Logger.debug("ready to call GridDataset.open for urlString = " 
+ urlString);
                GridDataset gridDataset = GridDataset.open(urlString);
                
//              if ( 1 == 2 )
//                      printGridDatasetInfo( gridDataset);

                return gridDataset;
        }   


> 1.) Version netcdfAll-4.3 worked. Versions netcdfAll-4.5.3 and 
> netcdfAll-4.5.jar dated 3/6/2015 (current one on your Web site, I believe) 
> both fail.
> 
> 2.) The source file for NetcdfDatasetFactory.java is attached.
> 
> Thank you for your prompt response yesterday. I hope that this is something 
> that will be an easy and quick fix for both of us.
> 
> Jo Ellen
> 
> 
> -----Original Message-----
> From: Unidata netCDF Java Support [mailto:address@hidden
> Sent: Monday, March 09, 2015 7:19 PM
> To: Brandmeyer, Jo Ellen
> Cc: address@hidden
> Subject: [netCDFJava #AYO-259890]: Malformed URL and .dds appended to URL
> 
> > Full Name: Jo Ellen Brandmeyer
> > Email Address: address@hidden
> > Organization: UNC Institute for the Environment Package Version:
> > current (4.5) Operating System: Windows 7
> > Hardware: 64-bit
> > Description of problem: We are working on the next release of VERDI. We 
> > updated the NetCDF-Java library to the most current version. Now we cannot 
> > open and display the data files. Our test data files have not been changed 
> > in over a year, and we did a step-wise update such that we could work with 
> > the test files, we updated the NetCDF-Java library, and we could not work 
> > with the files. For some reason, the failure shows a .dds appended to the 
> > URL. Please note that everything seems to run fine on Mac and Linux but 
> > fails on Windows. Test machine is Windows 7, 64-bit.
> >
> >
> 
> Hi Joellen:
> 
> It looks like the "file:" got stripped off somewhere.
> 
> 1) which version did you upgrade to? The one released yesterday (4.5.5)?
> 2) can you send me anl.verdi.loaders.NetcdfDatasetFactory.java ?
> 
> thanks
> 
> John
> 
> Ticket Details
> ===================
> Ticket ID: AYO-259890
> Department: Support netCDF Java
> Priority: Normal
> Status: Open
> 
> 

Ticket Details
===================
Ticket ID: AYO-259890
Department: Support netCDF Java
Priority: Normal
Status: Closed


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.