• Post Reply Bookmark Topic Watch Topic
  • New Topic

Weird IllegalMonitorStateException -- explanations/suggestions wanted

 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, all:
I'm getting an IllegalMonitorStateException in a weird line of code, and I'm not sure what is causing it. Here's the code:

The IllegalMonitorStateException is thrown at the aServer.insertElementWithKey(anElement, aKey, aMetadata); line of code. The exception states: "java.lang.IllegalMonitorStateException: current thread not owner"
This code worked fine when it was running locally, but when the code was moved to an EJB server and the process started remotely, it threw this exception.
[ June 07, 2002: Message edited by: Joel McNary ]
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I solved it almost immediately after I posted the message. (That's why I post messages; it makes me solve my problems faster ) It had nothing to do with the code; instead, the machine on which the code was written/compiled/tested was running Java 1.4, and the EJB server was running 1.2.2. 1.2.2 didn't like the 1.4 code, needless to say. I recompiled everything under 1.2.2, and it worked fine.
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, thats what happens to me too
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!