This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
IllegalMonitorStateException in URLClassLoader
- From: Juerg Lehni <lehni at gmx dot net>
- To: java at gcc dot gnu dot org
- Date: Thu, 25 May 2006 22:03:56 +0200
- Subject: IllegalMonitorStateException in URLClassLoader
I am still trying to solve the deadlock problem.
Instead of linking to the natively compiled java code, I tried to
load it from jar files now.
But now the code URLClassLoader that I use as the main thread's
ContextClassLoader to load all jar files from a folder throws this
strange error. When using other JVMs on both Mac and Windows, this
works fine.
java.lang.IllegalMonitorStateException: current thread not owner
at gnu.java.net.protocol.jar.Connection.getJarFile (libgcj.7.dylib)
at java.net.URLClassLoader$JarURLLoader.<init> (libgcj.7.dylib)
at java.net.URLClassLoader.addURLImpl (libgcj.7.dylib)
at java.net.URLClassLoader.addURLImpl (libgcj.7.dylib)
at java.net.URLClassLoader.addURLs (libgcj.7.dylib)
It seems to be a problem with GCJ but I could not figure out why this
happens. Any thougts?
I am invoking GCJ's virtual machine through JNI_CreateJavaVM. The
only changes in the project that works with Apple's JVM are: linking
to libgcj.7.dylib instead of JavaVM.framework and using GCJ's jni.h
instead of Apple's.
I hope someone can point me to possible solutions, as I am pretty
stuck now.
Jürg