Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unrecognized Windows Sockets error...

807597Nov 26 2002 — edited Jan 12 2008
Hello everybody!

I am encountering the following problem, when I try to run a program which wants to access the internet. I pasted an extract from the source code here, which I think includes the critical lines:

...
import java.net.*;
import java.io.*;

class FindLinks {
public static Vector findLinks (String address) throws Exception {
URL u = new URL(address);
InputStream ins = u.openStream();
InputStreamReader isr = new InputStreamReader(ins);
BufferedReader webPage = new BufferedReader(isr);
...


When I run the complete program, I get the following message:


Exception in thread "main" java.net.SocketException: Unrecognized Windows Sockets error: 10106: create
at java.net.Socket.createImpl(Socket.java:313)
at java.net.Socket.connect(Socket.java:424)
at java.net.Socket.connect(Socket.java:376)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:386)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:602)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:303)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:264)
at sun.net.www.http.HttpClient.New(HttpClient.java:336)
at sun.net.www.http.HttpClient.New(HttpClient.java:317)
at sun.net.www.http.HttpClient.New(HttpClient.java:312)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect HttpURLConnection.java:481)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:472)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:574)
at java.net.URL.openStream(URL.java:960)
at FindLinks.findLinks(FindLinks.java:10)
at FindLinks.main(FindLinks.java:47)


I am using the new Java SDK 1.41 on a Windows XP machine. Does anyone has an idea what might be causing this problem?

Kind regards
Linus
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 9 2008
Added on Nov 26 2002
23 comments
4,212 views