wood burning stoves 2.0*
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


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
Author

HttpsURLConnection gives ClassCastException in Weblogic 8.1

Kamalakar Sridhara
Greenhorn

Joined: Jun 06, 2004
Posts: 3
<p>
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
sun.net.www.protocol.https.HttpsURLConnectionImpl
how do i make the URLConnection Object as
sun.net.www.protocol.https.HttpsURLConnectionImpl even in weblogic 8.1 environment when i run.
</p><br><br>
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);
</pre></font>
Thanks
Srihari
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.
 
GeeCON Prague 2014
 
subject: HttpsURLConnection gives ClassCastException in Weblogic 8.1