Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.lang.IllegalMonitorStateException: current thread not owner

843834Feb 2 2002 — edited Dec 28 2006
Hi 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

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 25 2007
Added on Feb 2 2002
10 comments
2,096 views