LeninGovi created HTTPASYNC-37:
----------------------------------

             Summary: Too many file open in httpclient
                 Key: HTTPASYNC-37
                 URL: https://issues.apache.org/jira/browse/HTTPASYNC-37
             Project: HttpComponents HttpAsyncClient
          Issue Type: Bug
            Reporter: LeninGovi


Hi,

i have used httpclient 4.2.3 and to get the data from database .
Here i have written thread , it will execute one minute once 
this is my code

PoolingClientConnectionManager connectionManager = new 
PoolingClientConnectionManager();
                HttpClient httpclient = new 
DefaultHttpClient(connectionManager);
                HttpGet get = new 
HttpGet("http://10.163.29.105:5984/crl_archive1/_design/DataView/_view/viewAll";);
                try{
                        HttpResponse response = httpclient.execute(get);
                BufferedReader reader = new BufferedReader(new 
InputStreamReader(response.getEntity().getContent()));
        try{       
        while( (strdata =reader.readLine())!=null)
        {     
           output+=strdata;
        }
        }catch (Exception e) {
                e.printStackTrace();
        }
        //System.out.println("output:"+output);
        JSONParser parser=new JSONParser();
        String 
id="",rev="",ca_name="",crl_dt="",certificate_data="",url="",crl_cert="",entry_ts="";
        String filename="",flag="";
        Properties p=new Properties();
        
//p.load(getClass().getClassLoader().getResourceAsStream("config.properties"));
        FileInputStream f = new FileInputStream(
                        System.getProperty("user.dir") + File.separator+ 
"config.properties");
        p.load(f);
        String s=p.getProperty("thread");
        long l=Long.parseLong(s);
        Connection con=null;
        try{
                Object obj=parser.parse(output);
                JSONObject jobj=(JSONObject)obj;
                JSONArray jarray=(JSONArray)jobj.get("rows");
                if(jarray.size()>0){
                        try{
                                DBConnection dbc=new DBConnection();
                                con=dbc.getConnection();
                        }catch (Exception e) {
                                System.out.println("Connection 
failed:"+e.getMessage());
                                log.error(e.getMessage());
                        }
                }else{
                        if(con!=null){
                                con.close();
                                log.info("Database Closed");
                        }
                        get.releaseConnection();
                        get.abort();
                        connectionManager.closeExpiredConnections();
                        log.info("Client connection release");
                        System.out.println("Client Connection Closed:");
                }
it is working for some time after that getting error as s Too many file open..
Please help me how to solve it..
Thanks in advance
Regards
G.Lenin 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to