1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Cannot open a server socket

Discussion in 'Networking' started by vitaliy, Jul 4, 2007.

Thread Status:
Not open for further replies.
  1. vitaliy

    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
     
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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/591600

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice