This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]