Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-04-2007, 01:52 PM
Member
 
Join Date: Jul 2007
Posts: 2
vitaliy is on a distinguished road
java.net.SocketException: Permission denied: listen failed
Hello,

I'm experiencing the weirdest problem ever -
it seems that I"m unable to open a java server socket on my machine.

Here is a sample code that demonstrates my problem:

Code:
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:

Code:
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 ony 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

Last edited by JavaBean : 07-04-2007 at 01:57 PM. Reason: Codes are put inside [code] tags.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-06-2007, 08:43 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Hi Vitaliy,

The port should be used by another application. Windows XP has a built-in firewall. It might be the reason.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-09-2007, 12:20 PM
Member
 
Join Date: Jul 2007
Posts: 2
vitaliy is on a distinguished road
It's not a firewall issue
The windows firewall was down.

Anyway I've managed to resolve the problem -
I've reinstalled the jre at a different location -
and it works.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java failed to reach to a PC in local LAN JavaEmpires Networking 1 01-24-2008 07:30 PM
Initial SessionFactory creation failed escit Database 1 08-13-2007 04:46 AM
Loading of JSP file failed Heather JavaServer Pages (JSP) and JSTL 2 08-06-2007 02:15 AM


All times are GMT +3. The time now is 06:31 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org