Your code shows that you have created two instances of initial context (DirContext). Change the one in the process method to something else like, Context dctx2 = (Context) dctx.lookup("").
It looks the actual problem is with the URL i am using in the code , with the same code after replacing the URL with its IP address problem is resolved and i can connect as many times as required