Re: Compiling project using apache mina fails

Andrew Haley <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.