jQuery in Action, 3rd edition
The moose likes Sockets and Internet Protocols and the fly likes HttpsURLConnection gives ClassCastException in Weblogic 8.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "HttpsURLConnection gives ClassCastException in Weblogic 8.1" Watch "HttpsURLConnection gives ClassCastException in Weblogic 8.1" New topic

HttpsURLConnection gives ClassCastException in Weblogic 8.1

Kamalakar Sridhara

Joined: Jun 06, 2004
Posts: 3
I am getting an error when i run my application in weblogic 8.1 as
ClassCastException at URLConnection.
I know the reason after creating URLConneciton the object i am getting
is "weblogic.net.http.HttpsURLConnection"
but i run this application outside weblogic environment my application
is running fine & the Object is
how do i make the URLConnection Object as
sun.net.www.protocol.https.HttpsURLConnectionImpl even in weblogic 8.1 environment when i run.
this is the code i am using
<font size=2><pre>
String strUrl = "https:URL";
URL u1 = new URL(strUrl);
HttpsURLConnection huc = (HttpsURLConnection)u1.openConnection();
huc.setDoInput (true);
huc.setDoOutput (true);
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
It's been a while since I coded my https connection stuff, but from what I remember, some properties must be configured properly staticly (from the config files), or dynamically from the code like this:

I also recall that the code to get the connections should actually be

This still creates Https connection. Unfortunately, I don't recall all the details and the explanations for this. There is a large amount of info online regarding this issue.
I agree. Here's the link: http://aspose.com/file-tools
subject: HttpsURLConnection gives ClassCastException in Weblogic 8.1
It's not a secret anymore!