When I startup the Tomcat server it threw java.lang.IllegalMonitorStateException: current thread not owner
I never encountered any problem like this with Tomcat on Win 2k or XP, nor can reproduce this. There is probably a setup problem somewhere (or at least, you'll have to give very detailed instructions on how to reproduce thise - and for starters, you *must* include the full stack trace when dealing with never-before-seen errors).
I've seen this on Windows 98 with JDK 1.2.2, and it may be the same with other Windows versions and this old JDK. I noticed that it can be "fixed" by turning off the JIT, e.g. by setting JAVA_COMPILER=NONE. Looks like a JIT bug to me.
Thanks to Hans Bergsten, I set an envirionmental variable JAVA_COMPILER=NONE and the bug is fixed. Thanks once again.
I got exactly same error. I am using win98. ************************************************ D:\>D:\jakarta-tomcat-4.1.12\bin\startup start Using CATALINA_BASE: D:\jakarta-tomcat-4.1.12 Using CATALINA_HOME: D:\jakarta-tomcat-4.1.12 Using CATALINA_TMPDIR: D:\jakarta-tomcat-4.1.12\temp Using JAVA_HOME: D:\jdk1.2.2 1 "D:\jdk1.2.2\bin\java" -Djava.endorsed.dirs="D:\jakarta-tomcat-4.1.12\bin; D:\jakarta-tomcat-4.1.12\common\endorsed" -classpath "D:\jdk1.2.2\lib\tools.jar; D:\jakarta-tomcat-4.1.12\bin\bootstrap.jar" -Dcatalina.base="D:\jakarta-tomcat-4 .1.12" -Dcatalina.home="D:\jakarta-tomcat-4.1.12" -Djava.io.tmpdir="D:\jakarta-t omcat-4.1.12\temp" org.apache.catalina.startup.Bootstrap Bootstrap: Class loader creation threw exception java.lang.IllegalMonitorStateException: current thread not owner at org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal( StandardClassLoader.java, Compiled Code) at org.apache.catalina.loader.StandardClassLoader.<init>(StandardClassLo ader.java, Compiled Code) at org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(Clas sLoaderFactory.java, Compiled Code) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java, Compiled C ode) D:\> ************************************************
I also had the exact same problem on Win2k, JDK 1.2.2, Tomcat 4.1 and it got fixed with setting the environment variable JAVA_COMPILER=NONE.
Created attachment 3706 [details] java.lang.IllegalMonitorStateException: current thread not owner
I've also been getting this error and it seems to be a basic problem with running Tomcat 4 with JDK 1.2. Searching through the tomcat-user list showed a number of people were reporting this error. Some people seem to be able to resolve the problem with the JAVA_COMPILER=NONE fix. However, the actual root of the problem was pointed out as being a bug in java: http://developer.java.sun.com/developer/bugParade/bugs/4776385.html The suggested workaround of using the hotspot VM seems to have worked for me. To fix it on the Tomcat site would require compilation in 1.3 or 1.2 instead of 1.4, which is probably not feasible. Maybe this could be added to the Tomcat 4 FAQ?
I added this my FAQ. (http://tomcatfaq.sourceforge.net/) Hopefully the developers will add a note to the README file too. Changing status to WONTFIX since the public distribution from jakarta won't be compiled using jdk1.2.X. (I least that is my assumption) It will be up to the user to recompile from src tree.
When I shutdown tomcat (or when it is running), I get the error java.lang.IllegalMonitorStateException: current thread not owner
when I start server using startup.bat ,server runs for few seconds & automatically shuts down & also When Iam using shutdown.bat, I get the error java.lang.IllegalMonitorStateException: current thread not owner
*** Bug 24819 has been marked as a duplicate of this bug. ***
I installed the Apache Tomcat application server on a windows 2000 advanced server PC with service pack 3. When I tried to start the application via the configuration tool, the configuration tool's start button indicates that the application has started but there is nothing binding to port 8080 (the tomcat admin port). In addition I am not able to connect to http://127.0.0.1:8080. Finally when I check the tomcat log files there is nothing in "stderr.log or stdout.log files" but the "jakarta_service_20041111.log" file contains the following data below. [2004-11-11 15:34:37] [info] Service Tomcat5 name Apache Tomcat [2004-11-11 15:34:38] [info] Service Tomcat5 installed [2004-11-11 15:34:38] [info] Procrun finished. [2004-11-11 15:34:38] [info] Updating service... [2004-11-11 15:34:39] [info] Service Tomcat5 updated [2004-11-11 15:34:39] [info] Update service finished. [2004-11-11 15:34:39] [info] Procrun finished. [2004-11-11 15:34:44] [info] Updating service... [2004-11-11 15:34:44] [info] Service Tomcat5 updated [2004-11-11 15:34:44] [info] Update service finished. [2004-11-11 15:34:44] [info] Procrun finished. [2004-11-11 15:34:45] [info] Updating service... [2004-11-11 15:34:45] [info] Service Tomcat5 updated [2004-11-11 15:34:45] [info] Update service finished. [2004-11-11 15:34:45] [info] Procrun finished. [2004-11-11 15:34:49] [info] Running Service... [2004-11-11 15:34:49] [info] Starting service... [2004-11-11 15:34:52] [info] Service started in 2484 ms. [2004-11-11 15:34:56] [info] Run service finished. [2004-11-11 15:34:56] [info] Procrun finished. [2004-11-11 15:40:28] [info] Running Service... [2004-11-11 15:40:28] [info] Starting service... [2004-11-11 15:40:29] [info] Service started in 1265 ms. [2004-11-11 15:40:33] [info] Run service finished. [2004-11-11 15:40:33] [info] Procrun finished. [2004-11-11 15:43:02] [info] Running Service... [2004-11-11 15:43:02] [info] Starting service... [2004-11-11 15:43:13] [info] Service started in 11234 ms. [2004-11-11 15:43:21] [info] Run service finished. [2004-11-11 15:43:21] [info] Procrun finished. [2004-11-11 15:45:30] [info] Running Service... [2004-11-11 15:45:30] [info] Starting service... [2004-11-11 15:45:31] [info] Service started in 1265 ms. [2004-11-11 15:45:35] [info] Run service finished. [2004-11-11 15:45:35] [info] Procrun finished. [2004-11-11 15:49:18] [1193 prunsrv.c] [debug] Procrun log initialized [2004-11-11 15:49:18] [info] Running Service... [2004-11-11 15:49:18] [1036 prunsrv.c] [debug] Inside ServiceMain... [2004-11-11 15:49:18] [info] Starting service... [2004-11-11 15:49:18] [408 javajni.c] [debug] Jvm Option[0] -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 [2004-11-11 15:49:18] [408 javajni.c] [debug] Jvm Option[1] -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed [2004-11-11 15:49:18] [408 javajni.c] [debug] Jvm Option[2] -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp [2004-11-11 15:49:18] [408 javajni.c] [debug] Jvm Option[3] -Xrs [2004-11-11 15:49:18] [408 javajni.c] [debug] Jvm Option[4] -Djava.class.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar [2004-11-11 15:49:18] [408 javajni.c] [debug] Jvm Option[5] vfprintf [2004-11-11 15:49:19] [494 javajni.c] [debug] argv[0] = start [2004-11-11 15:49:20] [907 prunsrv.c] [debug] Java started org/apache/catalina/startup/Bootstrap [2004-11-11 15:49:20] [info] Service started in 1250 ms. [2004-11-11 15:49:20] [1110 prunsrv.c] [debug] Waitning worker to finish... [2004-11-11 15:49:24] [531 javajni.c] [debug] Java Worker thread finished [2004-11-11 15:49:24] [1115 prunsrv.c] [debug] Worker finished. [2004-11-11 15:49:24] [info] Run service finished. [2004-11-11 15:49:24] [info] Procrun finished. [2004-11-11 16:04:56] [1193 prunsrv.c] [debug] Procrun log initialized [2004-11-11 16:04:56] [info] Running Service... [2004-11-11 16:04:56] [1036 prunsrv.c] [debug] Inside ServiceMain... [2004-11-11 16:04:56] [info] Starting service... [2004-11-11 16:04:56] [408 javajni.c] [debug] Jvm Option[0] -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 [2004-11-11 16:04:56] [408 javajni.c] [debug] Jvm Option[1] -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed [2004-11-11 16:04:56] [408 javajni.c] [debug] Jvm Option[2] -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp [2004-11-11 16:04:56] [408 javajni.c] [debug] Jvm Option[3] -Xrs [2004-11-11 16:04:56] [408 javajni.c] [debug] Jvm Option[4] -Djava.class.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar [2004-11-11 16:04:56] [408 javajni.c] [debug] Jvm Option[5] vfprintf [2004-11-11 16:04:56] [494 javajni.c] [debug] argv[0] = start [2004-11-11 16:04:57] [907 prunsrv.c] [debug] Java started org/apache/catalina/startup/Bootstrap [2004-11-11 16:04:57] [info] Service started in 1265 ms. [2004-11-11 16:04:57] [1110 prunsrv.c] [debug] Waitning worker to finish... [2004-11-11 16:05:01] [531 javajni.c] [debug] Java Worker thread finished [2004-11-11 16:05:01] [1115 prunsrv.c] [debug] Worker finished. [2004-11-11 16:05:01] [info] Run service finished. [2004-11-11 16:05:01] [info] Procrun finished. [2004-11-11 16:05:13] [1193 prunsrv.c] [debug] Procrun log initialized [2004-11-11 16:05:13] [info] Running Service... [2004-11-11 16:05:13] [1036 prunsrv.c] [debug] Inside ServiceMain... [2004-11-11 16:05:13] [info] Starting service... [2004-11-11 16:05:13] [408 javajni.c] [debug] Jvm Option[0] -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 [2004-11-11 16:05:13] [408 javajni.c] [debug] Jvm Option[1] -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed [2004-11-11 16:05:13] [408 javajni.c] [debug] Jvm Option[2] -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp [2004-11-11 16:05:13] [408 javajni.c] [debug] Jvm Option[3] -Xrs [2004-11-11 16:05:13] [408 javajni.c] [debug] Jvm Option[4] -Djava.class.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar [2004-11-11 16:05:13] [408 javajni.c] [debug] Jvm Option[5] vfprintf [2004-11-11 16:05:13] [494 javajni.c] [debug] argv[0] = start [2004-11-11 16:05:14] [907 prunsrv.c] [debug] Java started org/apache/catalina/startup/Bootstrap [2004-11-11 16:05:14] [info] Service started in 1250 ms. [2004-11-11 16:05:14] [1110 prunsrv.c] [debug] Waitning worker to finish... [2004-11-11 16:05:18] [531 javajni.c] [debug] Java Worker thread finished [2004-11-11 16:05:18] [1115 prunsrv.c] [debug] Worker finished. [2004-11-11 16:05:18] [info] Run service finished. [2004-11-11 16:05:18] [info] Procrun finished. [2004-11-11 16:12:18] [1193 prunsrv.c] [debug] Procrun log initialized [2004-11-11 16:12:18] [info] Running Service... [2004-11-11 16:12:18] [1036 prunsrv.c] [debug] Inside ServiceMain... [2004-11-11 16:12:18] [info] Starting service... [2004-11-11 16:12:18] [408 javajni.c] [debug] Jvm Option[0] -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 [2004-11-11 16:12:18] [408 javajni.c] [debug] Jvm Option[1] -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed [2004-11-11 16:12:18] [408 javajni.c] [debug] Jvm Option[2] -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp [2004-11-11 16:12:18] [408 javajni.c] [debug] Jvm Option[3] -Xrs [2004-11-11 16:12:18] [408 javajni.c] [debug] Jvm Option[4] -Djava.class.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar [2004-11-11 16:12:18] [408 javajni.c] [debug] Jvm Option[5] vfprintf [2004-11-11 16:12:18] [494 javajni.c] [debug] argv[0] = start [2004-11-11 16:12:19] [907 prunsrv.c] [debug] Java started org/apache/catalina/startup/Bootstrap [2004-11-11 16:12:19] [info] Service started in 1265 ms. [2004-11-11 16:12:19] [1110 prunsrv.c] [debug] Waitning worker to finish... [2004-11-11 16:12:23] [531 javajni.c] [debug] Java Worker thread finished [2004-11-11 16:12:23] [1115 prunsrv.c] [debug] Worker finished. [2004-11-11 16:12:23] [info] Run service finished. [2004-11-11 16:12:23] [info] Procrun finished. [2004-11-11 16:13:04] [1193 prunsrv.c] [debug] Procrun log initialized [2004-11-11 16:13:04] [info] Running Service... [2004-11-11 16:13:04] [1036 prunsrv.c] [debug] Inside ServiceMain... [2004-11-11 16:13:04] [info] Starting service... [2004-11-11 16:13:04] [408 javajni.c] [debug] Jvm Option[0] -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 [2004-11-11 16:13:04] [408 javajni.c] [debug] Jvm Option[1] -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed [2004-11-11 16:13:04] [408 javajni.c] [debug] Jvm Option[2] -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp [2004-11-11 16:13:04] [408 javajni.c] [debug] Jvm Option[3] -Xrs [2004-11-11 16:13:04] [408 javajni.c] [debug] Jvm Option[4] -Djava.class.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar [2004-11-11 16:13:04] [408 javajni.c] [debug] Jvm Option[5] vfprintf [2004-11-11 16:13:04] [494 javajni.c] [debug] argv[0] = start [2004-11-11 16:13:05] [907 prunsrv.c] [debug] Java started org/apache/catalina/startup/Bootstrap [2004-11-11 16:13:05] [info] Service started in 1265 ms. [2004-11-11 16:13:05] [1110 prunsrv.c] [debug] Waitning worker to finish... [2004-11-11 16:13:09] [531 javajni.c] [debug] Java Worker thread finished [2004-11-11 16:13:09] [1115 prunsrv.c] [debug] Worker finished. [2004-11-11 16:13:09] [info] Run service finished. [2004-11-11 16:13:09] [info] Procrun finished. [2004-11-11 16:13:54] [1193 prunsrv.c] [debug] Procrun log initialized [2004-11-11 16:13:54] [info] Running Service... [2004-11-11 16:13:54] [1036 prunsrv.c] [debug] Inside ServiceMain... [2004-11-11 16:13:54] [info] Starting service... [2004-11-11 16:13:54] [408 javajni.c] [debug] Jvm Option[0] -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 [2004-11-11 16:13:54] [408 javajni.c] [debug] Jvm Option[1] -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed [2004-11-11 16:13:54] [408 javajni.c] [debug] Jvm Option[2] -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp [2004-11-11 16:13:54] [408 javajni.c] [debug] Jvm Option[3] -Xrs [2004-11-11 16:13:54] [408 javajni.c] [debug] Jvm Option[4] -Djava.class.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar [2004-11-11 16:13:54] [408 javajni.c] [debug] Jvm Option[5] vfprintf [2004-11-11 16:13:54] [494 javajni.c] [debug] argv[0] = start [2004-11-11 16:13:55] [907 prunsrv.c] [debug] Java started org/apache/catalina/startup/Bootstrap [2004-11-11 16:13:55] [info] Service started in 1265 ms. [2004-11-11 16:13:55] [1110 prunsrv.c] [debug] Waitning worker to finish... [2004-11-11 16:13:59] [531 javajni.c] [debug] Java Worker thread finished [2004-11-11 16:13:59] [1115 prunsrv.c] [debug] Worker finished. [2004-11-11 16:13:59] [info] Run service finished. [2004-11-11 16:13:59] [info] Procrun finished. [2004-11-11 16:14:46] [1193 prunsrv.c] [debug] Procrun log initialized [2004-11-11 16:14:46] [info] Running Service... [2004-11-11 16:14:46] [1036 prunsrv.c] [debug] Inside ServiceMain... [2004-11-11 16:14:46] [info] Starting service... [2004-11-11 16:14:46] [408 javajni.c] [debug] Jvm Option[0] -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 [2004-11-11 16:14:46] [408 javajni.c] [debug] Jvm Option[1] -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed [2004-11-11 16:14:46] [408 javajni.c] [debug] Jvm Option[2] -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp [2004-11-11 16:14:46] [408 javajni.c] [debug] Jvm Option[3] -Xrs [2004-11-11 16:14:46] [408 javajni.c] [debug] Jvm Option[4] -Djava.class.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar [2004-11-11 16:14:46] [408 javajni.c] [debug] Jvm Option[5] vfprintf [2004-11-11 16:14:46] [494 javajni.c] [debug] argv[0] = start [2004-11-11 16:14:47] [907 prunsrv.c] [debug] Java started org/apache/catalina/startup/Bootstrap [2004-11-11 16:14:47] [info] Service started in 1265 ms. [2004-11-11 16:14:47] [1110 prunsrv.c] [debug] Waitning worker to finish... [2004-11-11 16:14:51] [531 javajni.c] [debug] Java Worker thread finished [2004-11-11 16:14:51] [1115 prunsrv.c] [debug] Worker finished. [2004-11-11 16:14:51] [info] Run service finished. [2004-11-11 16:14:51] [info] Procrun finished. [2004-11-11 16:15:00] [1193 prunsrv.c] [debug] Procrun log initialized [2004-11-11 16:15:00] [info] Running Service... [2004-11-11 16:15:00] [1036 prunsrv.c] [debug] Inside ServiceMain... [2004-11-11 16:15:00] [info] Starting service... [2004-11-11 16:15:00] [408 javajni.c] [debug] Jvm Option[0] -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 [2004-11-11 16:15:00] [408 javajni.c] [debug] Jvm Option[1] -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed [2004-11-11 16:15:00] [408 javajni.c] [debug] Jvm Option[2] -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp [2004-11-11 16:15:00] [408 javajni.c] [debug] Jvm Option[3] -Xrs [2004-11-11 16:15:00] [408 javajni.c] [debug] Jvm Option[4] -Djava.class.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar [2004-11-11 16:15:00] [408 javajni.c] [debug] Jvm Option[5] vfprintf [2004-11-11 16:15:01] [494 javajni.c] [debug] argv[0] = start [2004-11-11 16:15:02] [907 prunsrv.c] [debug] Java started org/apache/catalina/startup/Bootstrap [2004-11-11 16:15:02] [info] Service started in 1281 ms. [2004-11-11 16:15:02] [1110 prunsrv.c] [debug] Waitning worker to finish... [2004-11-11 16:15:06] [531 javajni.c] [debug] Java Worker thread finished [2004-11-11 16:15:06] [1115 prunsrv.c] [debug] Worker finished. [2004-11-11 16:15:06] [info] Run service finished. [2004-11-11 16:15:06] [info] Procrun finished.
I am running Tomcat 5.5.12 and jdk1.5.0_06, and I still get this problem. This problem will happen from time to time, maybe after 3 days of normal running. The stack trace is : java.lang.IllegalMonitorStateException: current thread not owner at java.lang.Object.notifyAll(Native Method) at org.apache.tomcat.util.net.AprEndpoint$Worker.run (AprEndpoint.java:1216)
Michael, your bug is different, please open a new Bugzilla issue for it. Yours has to do with the AprEndpoint / APR connector, brand new to Tomcat 5.5, and does not have to do with the JIT/HotSpot/JDK 1.2.2 issues encountered earlier.