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]

Re: Compiling project using apache mina fails


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]