cancel
Showing results for 
Search instead for 
Did you mean: 

How to use HttpsURLConnection ???

Former Member
0 Kudos

Hi All,

I am facing problems while using <b>HttpsURLConnection</b>.

I have added library <b>com.sun.net.ssl</b> in my project and imported <b>com.sun.net.ssl.HttpsURLConnection.</b>

Then I made an object of HttpsURLConnection.... say con.

Then I have used the following code in the component controller..

////////////////////////////////////////////////////////////////////////////////////////////

HttpsURLConnection con = (HttpsURLConnection) new URL (<b>URLName</b>). openConnection() ;

///// <b>URLName</b> is any https url of type string////

con.setRequestMethod("HEAD") ;

wdComponentAPI.getMessageManager().reportSuccess("con.getResponseCode= "+ con.getResponseCode()) ;

////////////////////////////////////////////////////////////////////////////////////////////

upon executing the code I am getting an error

<b>" java.lang.NoClassDefFoundError: com.sun.net.ssl.HttpsURLConnection "</b>

Please help me out in this regard...

Thanks and Regards,

Sayan

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Sayan,

Put the jar file inside Project\src\mimes\Components\Package\ and set the build path to this jar file.Then deploy and run the application

If it is not working, then u have to deploy the jar file to server using this weblog

/people/bala.krishnan2/blog/2006/09/25/bid-adieu-to-bots--using-captchas

Regards

Fahad Hamsa

Former Member
0 Kudos

Hi,

You need to package this jar inside a external library DC and then deploy it on the portal. You should then have a library reference from your WD project to this library. Having this jar only in the build path will not work.

Regards,

Satyajit.

Former Member
0 Kudos

Hi Satyajit,

Thanks for the suggestion... can you please also guide how do I package the jar inside the external library DC and then deploy it on the portal ??? Also how to have a library reference from the WD project to this library ??

I am new in WD coding... So do not know much about these stuff...

Thanks and Regards,

Sayan

Former Member
0 Kudos

Hi,

Please go through <a href="/people/valery.silaev/blog/2005/09/14/a-bit-of-impractical-scripting-for-web-dynpro blog. It details how to use an external jar inside WD applications.

Regards,

Satyajit.