File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Threads and Synchronization and the fly likes Weird IllegalMonitorStateException -- explanations/suggestions wanted Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Weird IllegalMonitorStateException -- explanations/suggestions wanted" Watch "Weird IllegalMonitorStateException -- explanations/suggestions wanted" New topic
Author

Weird IllegalMonitorStateException -- explanations/suggestions wanted

Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1815
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 ]

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1815
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

Joined: Oct 05, 2001
Posts: 1170

Yep, thats what happens to me too
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: Weird IllegalMonitorStateException -- explanations/suggestions wanted
 
Similar Threads
IllegalMonitorStateException
Thread question doubt
opening serverSocket From servlet
Question on exceptions
detached entity vs. removed entity