- 3,723,264 Users
- 2,244,521 Discussions
- 7,850,383 Comments
Forum Stats
Discussions
Categories
- 16 Data
- 362.2K Big Data Appliance
- 7 Data Science
- 2.1K Databases
- 607 General Database Discussions
- 3.7K Java and JavaScript in the Database
- 32 Multilingual Engine
- 497 MySQL Community Space
- 7 NoSQL Database
- 7.7K Oracle Database Express Edition (XE)
- 2.8K ORDS, SODA & JSON in the Database
- 421 SQLcl
- 61 SQL Developer Data Modeler
- 185.1K SQL & PL/SQL
- 21.1K SQL Developer
- 2.4K Development
- 3 Developer Projects
- 32 Programming Languages
- 135.6K Development Tools
- 12 DevOps
- 3K QA/Testing
- 334 Java
- 10 Java Learning Subscription
- 12 Database Connectivity
- 71 Java Community Process
- 2 Java 25
- 11 Java APIs
- 141.2K Java Development Tools
- 8 Java EE (Java Enterprise Edition)
- 153K Java Essentials
- 135 Java 8 Questions
- 86.2K Java Programming
- 270 Java Lambda MOOC
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 16 Java SE
- 13.8K Java Security
- 4 Java User Groups
- 22 JavaScript - Nashorn
- 18 Programs
- 147 LiveLabs
- 34 Workshops
- 10 Software
- 4 Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 4 Deutsche Oracle Community
- 16 Español
- 1.9K Japanese
- 3 Portuguese
HTTPS ClassCastException for SOAPHttpsURLConnection to HttpsURLConnection

659191
Member Posts: 53
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:
java.lang.ClassCastException: com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl cannot be cast to javax.net.ssl.HttpsURLConnection
Ideas?
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?
Answers
-
Import this instead
import weblogic.net.http.SOAPHttpsURLConnection;
and then when attempting the connection try using the SOAPHttpsURLConnection object
This discussion has been closed.