1 Reply Latest reply on Jul 20, 2010 6:34 PM by orlandok

    HTTPS ClassCastException for SOAPHttpsURLConnection to HttpsURLConnection

    659191
      JDEV 11gR1PS1

      Hi all,

      I'm writing a Java class that posts via HTTPS. I'm getting the the following error when executing the class:

      java.lang.ClassCastException: weblogic.net.http.SOAPHttpsURLConnection cannot be cast to javax.net.ssl.HttpsURLConnection

      using the following code (just a snip of what's relevant:
                  url = new URL(nurl);
                  connection = (HttpsURLConnection)url.openConnection();
                  responseCode = connection.getResponseCode();
      I've also tried based on some research on the web
                  url = new URL(null, nurl, new com.sun.net.ssl.internal.www.protocol.https.Handler());
                  connection = (HttpsURLConnection)url.openConnection();
                  responseCode = connection.getResponseCode();
      and instead I this error

      java.lang.ClassCastException: com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl cannot be cast to javax.net.ssl.HttpsURLConnection

      Ideas?