Hi All 

I'm using Restlet webservice API to connect my Tomcat6 webserver ( which is
deployed in Linux box ), while my application is trying to communicate with
server, the connection is not getting closed, due to this after some
interactions it is throwing " Communication Error (1001) - Too many open
files " Error and server stops serving. 

My client code of Restlet is releasing connection properly, but it didn't
helps me, can anyone of you please help me on this? 

I see opened connections by using "netstat -a" command in server.
here is the same which i found i server.

tcp        1      0 10.240.93.190:33006     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33007     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33004     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33005     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33002     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33003     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33000     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33001     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:32999     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:32997     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:32993     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33022     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33023     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33020     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33021     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33018     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33019     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33016     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33017     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33014     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33015     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33012     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33013     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33011     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33030     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33029     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33028     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33027     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33026     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33025     iad04s01-in-f141.1e:www
CLOSE_WAIT
tcp        1      0 10.240.93.190:33024     iad04s01-in-f141.1e:www
CLOSE_WAIT

Here is my client code: 

view plaincopy to clipboardprint?
ClientResource client = new
ClientResource("http://mylocal.com:8080/test?code=123";);  
        SampleDTO lSampleDTO = null;  
        try {  
            client.get();  
            ObjectRepresentation<ArrayList> objectRepresentation1 = null;  
            if (client.getStatus().isSuccess()) {  
                lObjectRepresentation = new ObjectRepresentation<SampleDTO>(  
                        client.getResponseEntity());  
                lSampleDTO= lObjectRepresentation.getObject();  
            }  
        }catch (Exception e) {  
            e.printStackTrace();  
        }finally{  
            //ClientResource.getResponseEntity().release();  
               client.release();  
               client.getResponseEntity().release();  
               lObjectRepresentation.exhaust();
               lObjectRepresentation.release();  
                 
        }  


Server Code: 

view plaincopy to clipboardprint?
public class AccountDetails extends ServerResource{  
   @Get  
    public SampleDTP getSampleDTO()  
{  
try{  
 String accountNumber=getQuery().getValues("code");  
} catch (Exception e) {  
        e.printStackTrace();  
    }  
    return sampleDTO;  
}  
}  


I really appreciate if you have any solutioins. 

--
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/Restlet-connection-is-not-closing-tp6524615p6524615.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2779490

Reply via email to