Forum Stats

  • 3,723,264 Users
  • 2,244,521 Discussions
  • 7,850,383 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

HTTPS ClassCastException for SOAPHttpsURLConnection to HttpsURLConnection

659191
659191 Member Posts: 53
edited July 2010 in JDeveloper and ADF
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?
Tagged:

Answers

This discussion has been closed.