aspose file tools*
The moose likes Java in General and the fly likes java.net.SocketException: No buffer space available (maximum connections reached?): connect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "java.net.SocketException: No buffer space available (maximum connections reached?): connect" Watch "java.net.SocketException: No buffer space available (maximum connections reached?): connect" New topic
Author

java.net.SocketException: No buffer space available (maximum connections reached?): connect

Davidson Rajapal
Greenhorn

Joined: Nov 02, 2011
Posts: 20
Hi,

I have below partial code which is accessing this URL http://cog8dv01.merck.com:26423/p2pd/servlet/dispatch


//Constructor

public well(String sendPoint)
{

endPoint = sendPoint;
try
{
cmServiceLocator = new ContentManagerService_ServiceLocator();
reportServiceLocator = new ReportService_ServiceLocator();



URL url = new URL(endPoint);
cmService = cmServiceLocator.getcontentManagerService(url);
repService = reportServiceLocator.getreportService(url);
((Stub) cmService).setTimeout(0);
((Stub) repService).setTimeout(0);
}
catch (Exception e)
{
System.out.println(e);
}
}

public ReportService_Port getReportService()
{
BiBusHeader bibus = null;
bibus =
(BiBusHeader) ((Stub)repService).getHeaderObject("", "biBusHeader");

if (bibus == null)
{
BiBusHeader CMbibus = null;
CMbibus =
(BiBusHeader) ((Stub)cmService).getHeaderObject("", "biBusHeader");
if (CMbibus != null)
((Stub)repService).setHeader("", "biBusHeader", CMbibus);
}
return repService;
}


But I am receiving this below Error...Can you help to Eradicate this Error

C:\Program Files\Java\jdk1.6.0_27\bin>java well

java.net.SocketException: No buffer space available (maximum connections reached
?): connect
java.net.SocketException: No buffer space available (maximum connections reached
?): connect



Let me know If you need any other information??
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Given the error, I can only guess that it might be one of three things: 1) You're executing that in a loop, and not closing sockets when you're done. 2) The user you're executing as has a very low socket or file descriptor limit set by the system's admin. 3) The system has something else running on it that is eating up all its sockets or FDs. Hard to say more without more details.

Also, rather than using [ b ] tags to make your code bold, please UseCodeTags to make it readable.
Davidson Rajapal
Greenhorn

Joined: Nov 02, 2011
Posts: 20
Hi,

I have very big code..So I cant paste it. Are you mentioning any function which will cause this problem. Can you please correct me where to close that function...I have some other parts of code below..Please let me know if you want any specific information.

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

Davidson Hosannah wrote:

Probably unrelated to this issue, but this first line is useless. You create an array that can store 100,000 BaseClass references, then immediately discard it because you assign a different value to the variable.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Davidson Rajapal
Greenhorn

Joined: Nov 02, 2011
Posts: 20
Do you want me to reduce that array size? Please let me know what I need to modify. Still I am receiving this Error. I need to solve this Error
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

Just make it one line:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.net.SocketException: No buffer space available (maximum connections reached?): connect