java.lang.IllegalMonitorStateException: current thread not owner
843834Feb 2 2002 — edited Dec 28 2006Hi Friend,
I was coding a JSP page. Iam using some beans in that. For performance, I have used the synchronized keyword. Whenever I use Vectors, before adding elements, Iam using a code block which is synchronized.
eg:
synchronized(myVector)
{
myVector.addElement("elem1");
myVector.addELement("elem2");
:
:
}//synchronized
Sometimes Iam getting the error
"java.lang.IllegalMonitorStateException: current thread not owner"
in the web page. When I tried removing this, it worked fine. But why is this happening. ? If anyone can help me, I will be very grateful to you..
Thanking u in anticipation
regards
Narayanan