javax.net.ssl.HttpsURLConnection  
Author Message
ma2thieul





PostPosted: 2004-7-7 16:33:00 Top

java-programmer, javax.net.ssl.HttpsURLConnection Hello,
I need the library javax.net.ssl.HttpsURLConnection.
But all the package i find where there is javax.net.ssl do not
contained the class HttpsURLConnection.
Does anyone have an idea where i can find it ?
Thank's a lot for your help
Sorry for my English?I'm French ;)
 
Christophe Vanfleteren





PostPosted: 2004-7-7 16:39:00 Top

java-programmer >> javax.net.ssl.HttpsURLConnection ma2thieu wrote:

> Hello,
> I need the library javax.net.ssl.HttpsURLConnection.
> But all the package i find where there is javax.net.ssl do not
> contained the class HttpsURLConnection.
> Does anyone have an idea where i can find it ?
> Thank's a lot for your help
> Sorry for my English?I'm French ;)

<http://java.sun.com/j2se/1.4.2/docs/api/javax/net/ssl/HttpsURLConnection.html>

Are you using a JDK > 1.4?
As you can see in the Javadocs, this is the first JDK the class appeared in.

--
Kind regards,
Christophe Vanfleteren
 
KC Wong





PostPosted: 2004-7-7 16:52:00 Top

java-programmer >> javax.net.ssl.HttpsURLConnection > I need the library javax.net.ssl.HttpsURLConnection.
> But all the package i find where there is javax.net.ssl do not
> contained the class HttpsURLConnection.
> Does anyone have an idea where i can find it ?

Use Winzip or JAR to look inside jsse.jar inside your JRE's lib directory.
HttpsURLConnection.class is right there. But I guess this is not your real
problem.

Try this in command prompt:

javap javax.net.ssl.HttpsURLConnection

It will display the class declaration and method signatures of the class.
You'll see it's an *abstract* class.

I guess that's your real problem - trying to instantiate HttpsURLConnection.
To use HttpsURLConnection, you use an implementation (subclass) of it. This
post, found via Google Groups, has an example.

(http://groups.google.com/groups?q=HttpsURLConnection+create&start=10&hl=en&
lr=&ie=UTF-8&selm=f8db8edf.0207240927.4a82e25b%40posting.google.com&rnum=13)


 
 
ma2thieul





PostPosted: 2004-7-8 15:33:00 Top

java-programmer >> javax.net.ssl.HttpsURLConnection "KC Wong" <email***@***.com> wrote in message news:<email***@***.com>...
> > I need the library javax.net.ssl.HttpsURLConnection.
> > But all the package i find where there is javax.net.ssl do not
> > contained the class HttpsURLConnection.
> > Does anyone have an idea where i can find it ?
>
> Use Winzip or JAR to look inside jsse.jar inside your JRE's lib directory.
> HttpsURLConnection.class is right there. But I guess this is not your real
> problem.
>
> Try this in command prompt:
>
> javap javax.net.ssl.HttpsURLConnection
>
> It will display the class declaration and method signatures of the class.
> You'll see it's an *abstract* class.
>
> I guess that's your real problem - trying to instantiate HttpsURLConnection.
> To use HttpsURLConnection, you use an implementation (subclass) of it. This
> post, found via Google Groups, has an example.
>
> (http://groups.google.com/groups?q=HttpsURLConnection+create&start=10&hl=en&
> lr=&ie=UTF-8&selm=f8db8edf.0207240927.4a82e25b%40posting.google.com&rnum=13)


I used winrar and i looked inside the package, there were not the class I want.
The problem is not a problem of instantiation : the class is not found by eclipse.
but I used the jdk 1.3.1, maybe the problem is there. May I download the last jdk ?

thank you both
 
 
ma2thieul





PostPosted: 2004-7-8 16:32:00 Top

java-programmer >> javax.net.ssl.HttpsURLConnection "KC Wong" <email***@***.com> wrote in message news:<email***@***.com>...
> Use Winzip or JAR to look inside jsse.jar inside your JRE's lib directory.
> HttpsURLConnection.class is right there. But I guess this is not your real
> problem.
>
> Try this in command prompt:
>
> javap javax.net.ssl.HttpsURLConnection
>
> It will display the class declaration and method signatures of the class.
> You'll see it's an *abstract* class.
>
> I guess that's your real problem - trying to instantiate HttpsURLConnection.
> To use HttpsURLConnection, you use an implementation (subclass) of it. This
> post, found via Google Groups, has an example.
>
> (http://groups.google.com/groups?q=HttpsURLConnection+create&start=10&hl=en&
> lr=&ie=UTF-8&selm=f8db8edf.0207240927.4a82e25b%40posting.google.com&rnum=13)

It was a good idea, thanks :
I have downloaded the jdk1.5 (beta)
There is the jsse.jar and the class i want
I put it in my eclipse project
I compile (all is ok)
I make a .jar with my project (no problem)
And when i run : java.lang.NoClassDefFoundError: javax/net/ssl/HttpsURLConnection

Any idea of what is the problem ?
 
 
KC Wong





PostPosted: 2004-7-8 17:55:00 Top

java-programmer >> javax.net.ssl.HttpsURLConnection > It was a good idea, thanks :
> I have downloaded the jdk1.5 (beta)

Yes, I missed that one - Christophe Vanfleteren is correct. You need at
least 1.4 or later to use the class.

> There is the jsse.jar and the class i want
> I put it in my eclipse project
> I compile (all is ok)
> I make a .jar with my project (no problem)
> And when i run : java.lang.NoClassDefFoundError:
javax/net/ssl/HttpsURLConnection
>
> Any idea of what is the problem ?

Then the problem is most likely in your runtime environment. Do you run it
inside Eclipse or outside?

If you're running it outside Eclipse, type in command prompt:

java -version

to make sure you're using version 1.5 beta. If it shows your old version
(1.3), then you'll need to configure your PATH and JAVA_HOME environment
variables.


 
 
ma2thieul





PostPosted: 2004-7-8 23:08:00 Top

java-programmer >> javax.net.ssl.HttpsURLConnection >
> Yes, I missed that one - Christophe Vanfleteren is correct. You need at
> least 1.4 or later to use the class.
>
> Then the problem is most likely in your runtime environment. Do you run it
> inside Eclipse or outside?
>
> If you're running it outside Eclipse, type in command prompt:
>
> java -version
>
> to make sure you're using version 1.5 beta. If it shows your old version
> (1.3), then you'll need to configure your PATH and JAVA_HOME environment
> variables.

Finally i solve the problem : it was not the good package

(there are at least three :
javax.net.ssl
com.sun.net.ssl
and (the one i need) com.sun.net.ssl.internal.www.protocol.https )

thank you for helping me
 
 
ma2thieul





PostPosted: 2004-7-8 23:20:00 Top

java-programmer >> javax.net.ssl.HttpsURLConnection "KC Wong" <email***@***.com> wrote in message news:<email***@***.com>...
>
> Yes, I missed that one - Christophe Vanfleteren is correct. You need at
> least 1.4 or later to use the class.
>
> Then the problem is most likely in your runtime environment. Do you run it
> inside Eclipse or outside?
>
> If you're running it outside Eclipse, type in command prompt:
>
> java -version
>
> to make sure you're using version 1.5 beta. If it shows your old version
> (1.3), then you'll need to configure your PATH and JAVA_HOME environment
> variables.

sorry i did not see your answer before, and you are right
I was outside eclipse, and that was not the jdk 1.5, and i cannot
change the jdk, so i had to find another solution
(find another package which works with 1.3)

Thanks a lot!