Compiling project using apache mina fails

Andrew Haley aph@redhat.com
Fri Jun 5 15:31:00 GMT 2009


Patrick Schäfer wrote:

> I am trying to compile a project using the apache mina library to native
> code using gcj. I succeeded building the native library but the program
> fails with an exception while trying to access VMThreadMXBeanImpl.
> getThreadInfoForId():
> 
> java.lang.UnsupportedOperationException:
> gnu::java::lang::management::VMThreadMXBeanImpl::getThreadInfoForId
> (jlong, jint) not implemented
>   at
> gnu.java.lang.management.ThreadMXBeanImpl.getThreadInfo(libgcj.9.dylib)
>   at java.lang.reflect.Method.invoke(libgcj.9.dylib)
>   at java.lang.Thread.getStackTrace(libgcj.9.dylib)

This is a bug in libgcj.  There really is no good reason that
Thread.getStackTrace() should be calling
ManagementFactory.getThreadMXBean().getThreadInfo().getStackTrace().

Please try replacing the call to Thread.getStackTrace() with
new Throwable().getStackTrace().

Andrew.



More information about the Java mailing list