This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
<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
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.