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

[netCDFJava #RAN-171087]: "javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection" for proxy connections



> The real problem at the moment is If I call
> "proxyurl = 'http://ourproxyURL.de:portnumber'
> ucar.httpservices.HTTPSession.setGlobaProxy(proxyurl) "

Are these calls in Matlab or in Java. If Java, then there probably
needs to be a semicolon between the two lines.

> In Matlab:
> 
> The MatLab error described in my last email:
> "java.lang.NoClassDefFoundError:
> Could not initialize class ucar.httpservices.HTTPSession"
> was possibly self-constructed, because I did comment out
> setGlobalProxy() during the call.
> 
> The real problem at the moment is If I call
> "proxyurl = 'http://ourproxyURL.de:portnumber'
> ucar.httpservices.HTTPSession.setGlobaProxy(proxyurl) "
> 
> I get the error:
> "Undefined variable "ucar" or class
> "ucar.httpservices.HTTPSession.setGlobalProxy"."
> 
> The HTTPSession.class file is present in the "subdirectories"
> ucar.httpservices of the jar file.  I can see that using the
> Matlab explorer window on the right of the Matlab GUI.
> 
> Additionally, the same call HTTPSession.setGlobaProxy() is
> apparently successful in the java program see below.
> 
> 
> 
> In Java:
> 
> Changing to slf4j-jdk14-1.7.25.jar was successfull.
> The slf4j error is gone.
> 
> I got an error concerning ucar.httpservices.HTTPSession.setGlobaProxy().
> 
> The call HTTPSession.setGlobaProxy(proxyurl) does not lead to an error.
> 
> I seem to be able to open a dataset (using setGlobalProxy) and
> get the file's location correctly using the following code.
> 
> "import ucar.nc2.dataset.NetcdfDataset;
> import ucar.httpservices.HTTPSession;
> import java.lang.Throwable;
> 
> public class JavaProxyTest {
> public static void main( String[] args ) {
> NetcdfDataset ncd = null;
> String        url;
> String        proxyurl;
> String        location;
> 
> url = "https://nomads.ncdc.noaa.gov/thredds/dodsC/modeldata/\
> cmd_pgbh/2008/200811/20081101/pgbh00.gdas.2008110100.grb2";
> proxyurl = "http://ourproxyURL.de:portnumber";;
> 
> try {
> 
> HTTPSession.setGlobalProxy(proxyurl);
> ncd = NetcdfDataset.openDataset(url);
> location = ncd.getLocation();
> System.out.println( location );
> 
> } catch(Exception e) {
> 
> e.printStackTrace();
> 
> } finally {
> 
> try {
> 
> ncd.close();
> 
> } catch(Exception e) {
> 
> e.printStackTrace();
> 
> }
> }
> }
> }"
> 
> However I am not fully sure the file access works.  If I try to
> print the title or get to the data itself using some additional
> lines:
> "
> ...
> String        title;
> String        location;
> Variable      variable;
> Array         values;
> 
> url       = "https://nomads.ncdc.noaa.gov/thredds/dodsC/\
> modeldata/cmd_pgbh/2008/200811/20081101/pgbh00.gdas.2008110100.grb2";
> proxyurl  = "http://ourproxyURL.de:portnumber";;
> 
> try {
> // HTTPSession.setGlobalProxy(proxyname,port);
> HTTPSession.setGlobalProxy(proxyurl);
> 
> ncd      = NetcdfDataset.openDataset(url);
> title    =  ncd.getTitle(); // gives null
> location = ncd.getLocation();
> 
> variable = ncd.findVariable("Temperature @ Specified height \
> level above ground"); //gives null
> values   = variable.read();
> 
> System.out.println( location );
> System.out.println( "Variablenwert der 1sten Zeile und Spalte:"\
> + values.getDouble(1) );
> 
> } catch(Exception e) {
> ...
> A null is printed for the title.
> 
> And trying to print the data leads to the error:
> "java.lang.NullPointerException
> at JavaProxyTest.main(JavaProxyTest.java:43)"
> 
> Line 43 is: "values   = variable.read();"
> 
> I assume I should give the "Array values" a constant size before
> writing into it, but I don't know how, as me Java knowledge is
> limited.
> 
> "Array[2][2] values; " gives me an error for values being of
> type "Array" not "array".
> 
> --
> Dipl.-Phys. Marius Kist
> Fraunhofer-Institut für Optronik, Systemtechnik und Bildauswertung IOSB
> Abteilung Signatorik
> Gutleuthausstr. 1, 76275 Ettlingen, Germany
> Phone +49 7243 992-223
> address@hidden
> www.iosb.fraunhofer.de/sig
> 
> -----Ursprüngliche Nachricht-----
> Von: Unidata netCDF Java Support [mailto:address@hidden]
> Gesendet: Donnerstag, 28. September 2017 19:56
> An: Kist, Marius
> Cc: address@hidden; address@hidden
> Betreff: [netCDFJava #RAN-171087]: "javax.net.ssl.SSLException:
> Unrecognized SSL message, plaintext connection" for proxy connections
> 
> Hi Marius,
> 
> I may be able to help with the slf4j error. Try using this jar instead:
> 
> http://central.maven.org/maven2/org/slf4j/slf4j-jdk14/1.7.25/\
> slf4j-jdk14-1.7.25.jar
> 
> slf4j-log4j12 could work, but it has other dependencies that
> you'd need to include as well. slf4j-jdk14, on the other hand, is
> self-contained.
> 
> Cheers,
> Christian
> 
> Ticket Details
> ===================
> Ticket ID: RAN-171087
> Department: Support netCDF Java
> Priority: Normal
> Status: Open
> ===================
> 
> 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.

=Dennis Heimbigner
  Unidata


Ticket Details
===================
Ticket ID: RAN-171087
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.