Operating System - HP-UX
1840366 Members
3103 Online
110163 Solutions
New Discussion

Java socket bind exception

 
Chamitha Wijesekera
Frequent Advisor

Java socket bind exception

Hi, I get this socket connection bind error when attemptiong to connect to a socket. The strange part of it is that my application creates and connects 4 sockets but the exception is always thrown by the 3rd socket. The 4th socket once again connected successfully! The error messge I get is as follows,

Error accepting a connection. Exception java.net.BindException occurred. reason: Permission denied
java.net.BindException: Permission denied
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.(Unknown Source)
at java.net.ServerSocket.(Unknown Source)

I have installed patch number PHKL_25871 and its dependent patches. Are there any other patches required to fix this?
2 REPLIES 2
Chamitha Wijesekera
Frequent Advisor

Re: Java socket bind exception

I dont get this issue if I run the application as super user. So I was guessing this would be a rights issue. The socket is created on a port greater than 1024 thus it does not overlap any ports that are in use.
Chamitha Wijesekera
Frequent Advisor

Re: Java socket bind exception

I see. But the wiered part is that it successfully threw an exception when I ran the program as super user on another HP-UX machine!