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.
the url part is fine. The issue has to do with url escaping and especially with escaping of the constraint. For those of you running non-tds servers, the question is: do you unescape the query part or not upon receiving the incoming url. Roland Schweitzer wrote:
On 10/03/2011 03:37 AM, Raymond Cramer wrote:I am having a similar problem. From a browser I can return ASCII data, so theOPeNDAP is working.http://...../thredds/dodsC/vault/..._cf.nc.ascii?crs,depth[3599:1:3719][19199:1:19319]If I try to access this through code, using http my log file fills up with msgs which suggests I can't use http (or something else needs setting ;-)):I believe that the only way to do this via the Java API is to open the unconstrained URL (http://...../thredds/dodsC/vault/..._cf.nc) and then use the API to request the hyperslab you want rather than trying to open the constrained URL.RolandExceptionhttp://....:8080/thredds/dodsC/vault/...._cf.nc?crs,depth[3600:1:3719][19200:1:19319],lat[3600:1:3719],lon[19200:1:19319]java.lang.IllegalArgumentException: Invalid uri'http://....:8080/thredds/dodsC/vault/...._cf.nc?crs,depth[3600:1:3719][19200:1:19319],lat[3600:1:3719],lon[19200:1:19319]':Invalid query atorg.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:222)atorg.apache.commons.httpclient.methods.HeadMethod.<init>(HeadMethod.java:94)atucar.unidata.io.http.HTTPRandomAccessFile.<init>(HTTPRandomAccessFile.java:92)atucar.unidata.io.http.HTTPRandomAccessFile.<init>(HTTPRandomAccessFile.java:78)at ucar.nc2.NetcdfFile.getRaf(NetcdfFile.java:300) at ucar.nc2.NetcdfFile.open(NetcdfFile.java:281) at ucar.nc2.dataset.NetcdfDataset.openFile(NetcdfDataset.java:335) at ucar.nc2.dataset.NetcdfDataset.openFile(NetcdfDataset.java:280) ...If I try to use dods, I get a lot more msgs, it accesses the file, outputs the header data but fails on the data (when the call becomes http again forthe DAS?):[org.apache.commons.httpclient.HttpMethodBase] Resorting to protocol versiondefault close connection policy[org.apache.commons.httpclient.HttpMethodBase] Should NOT close connection,using HTTP/1.1 [org.apache.commons.httpclient.HttpConnection] enter HttpConnection.isResponseAvailable() [org.apache.commons.httpclient.HttpConnection] enter HttpConnection.releaseConnection()[org.apache.commons.httpclient.HttpConnection] Releasing connection back toconnection manager. [org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] enter HttpConnectionManager.releaseConnection(HttpConnection)[org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] Freeingconnection, hostConfig=HostConfiguration[host=http://....:8080] [org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] enter HttpConnectionManager.ConnectionPool.getHostPool(HostConfiguration)[org.apache.commons.httpclient.util.IdleConnectionHandler] Adding connectionat: ........[org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] Notifyingno-one, there are no waiting threads [ucar.nc2.dods.DODSNetcdfFile] DODSNetcdfFiledods://....:8080/thredds/dodsC/vault/...._cf.nc?crs,depth[3600:1:3719][19200:1:19319],lat[3600:1:3719],lon[19200:1:19319]java.lang.IllegalArgumentException: Invalid uri'http://....:8080/thredds/dodsC/vault/...._cf.nc.das?crs,depth[3600:1:3719][19200:1:19319],lat[3600:1:3719],lon[19200:1:19319]':Invalid query atorg.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:222)at org.apache.commons.httpclient.methods.GetMethod.<init>(GetMethod.java:89) at opendap.dap.DConnect2.openConnection(DConnect2.java:205) at opendap.dap.DConnect2.getDAS(DConnect2.java:399) at ucar.nc2.dods.DODSNetcdfFile.<init>(DODSNetcdfFile.java:186) at ucar.nc2.dataset.NetcdfDataset.openDODS(NetcdfDataset.java:379) at ucar.nc2.dataset.NetcdfDataset.openFile(NetcdfDataset.java:316) at ucar.nc2.dataset.NetcdfDataset.openFile(NetcdfDataset.java:280) ..... ERROR [uk.ac.bodc.Netcdf_Utils] trying to opendods://....:8080/thredds/dodsC/vault/...._cf.nc?crs,depth[3600:1:3719][19200:1:19319],lat[3600:1:3719],lon[19200:1:19319]java.io.FileNotFoundException: Cant opendods://....:8080/thredds/dodsC/vault/...._cf.nc?crs,depth[3600:1:3719][19200:1:19319],lat[3600:1:3719],lon[19200:1:19319]or as DODSdods://....:8080/thredds/dodsC/vault/...._cf.nc?crs,depth[3600:1:3719][19200:1:19319],lat[3600:1:3719],lon[19200:1:19319]Invalid uri'http://....:8080/thredds/dodsC/vault/...._cf.nc.das?crs,depth[3600:1:3719][19200:1:19319],lat[3600:1:3719],lon[19200:1:19319]':Invalid query at ucar.nc2.dataset.NetcdfDataset.openDODS(NetcdfDataset.java:381) at ucar.nc2.dataset.NetcdfDataset.openFile(NetcdfDataset.java:316) at ucar.nc2.dataset.NetcdfDataset.openFile(NetcdfDataset.java:280) .... I am accessing this through inFile = NetcdfDataset.openFile(inFileName, null); I hope I haven't broken any rules for the length of this msg, hopefully there's sufficient info that someone recognises the problem. --View this message in context: http://netcdf-java.1577316.n2.nabble.com/Getting-a-NetcdfFile-object-from-a-dods-url-tp6677113p6854222.htmlSent from the NetCDF-Java mailing list archive at Nabble.com. _______________________________________________ netcdf-java mailing list netcdf-java@xxxxxxxxxxxxxxxxFor list information or to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/_______________________________________________ netcdf-java mailing list netcdf-java@xxxxxxxxxxxxxxxxFor list information or to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/
netcdf-java
archives: