• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Davidson Rajapal
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Davidson Rajapal
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just make it one line:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic