And what exactly is the question? After reading your post, I'm not sure what you are asking about. And posting an unrelated (to the question) exception is going to make it more confusing.
Hi Jai actually the first code creating the below exception my point is to find solution from the below exception and for that I am asking for solutions ...thread and synchronization is one of my thought to put the code above so that I can get the solution for the problem I am getting plus the above exception can also be handled by it...