Cannot open a server socket

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

vitaliy

Thread Starter
Joined
Jul 4, 2007
Messages
1
Hello,

I'm experiencing the weirdest problem ever -
it seems that I'm unable to open a server socket on my machine.
I've encountered this problem through a number of applications running on my pc, that suddenly stopped working properly - such as tomcat and sql server.

To make sure that it is the case, I wrote a sample test case that demonstrates my problem:

-------------------------------------------------------------------------------------------------
import java.io.IOException;
import java.net.*;

public class SocketTest
{

/**
* @param args
*/
public static void main(String[] args)
{

ServerSocket myService;

try
{
myService = new ServerSocket(8080);
System.out.println("successfully opened a socket");

}
catch (IOException e)
{
e.printStackTrace();
System.out.println(e);
}


}

}

------------------------------------------------------------------------------------------------

Here is the exception that I get:

-----------------------------------------------------------------------------------------------
java.net.SocketException: Permission denied: listen failed
at java.net.PlainSocketImpl.socketListen(Native Method)
at java.net.PlainSocketImpl.listen(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at SocketTest.main(SocketTest.java:18)
java.net.SocketException: Permission denied: listen failed
------------------------------------------------------------------------------------------------

I'm trying to run this app on winxp machine, jre 1.5.0_11.
This problem also happens not only while running this application, but while trying to start other java applications like tomcat.

If I try to connect to already used port, I get a different exception, so I know this port is free.
I've already tried to reinstall the jre, as well as rebooting my machine.
Also I have no firewall or antivirus running.


Any help is highly appreciated!

Thanks,
Vitaliy
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top