* Compiling project using apache mina fails
@ 2009-06-05 14:38 Patrick Schäfer
2009-06-05 15:31 ` Andrew Haley
2009-06-07 18:32 ` Patrick Schäfer
0 siblings, 2 replies; 6+ messages in thread
From: Patrick Schäfer @ 2009-06-05 14:38 UTC (permalink / raw)
To: java
Hi,
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)
at
org.apache.mina.core.future.DefaultIoFuture.checkDeadLock(ppp_mina)
at org.apache.mina.core.future.DefaultIoFuture.await0(ppp_mina)
at
org
.apache.mina.core.future.DefaultIoFuture.awaitUninterruptibly(ppp_mina)
at
org
.apache
.mina.core.future.DefaultConnectFuture.awaitUninterruptibly(ppp_mina)
at ppp.networklayer.pppClient.connect(ppp_mina)
at ppp.networklayer.pppClient.init(ppp_mina)
at ppp.networklayer.pppClient.<init>(ppp_mina)
at ppp.networklayer.pppClientFactory.getClient(ppp_mina)
at ppp.networklayer.pppClientFactory.getClient(ppp_mina)
at ppp.networklayer.pppClient.connectToServer(ppp_mina)
at
ppp.remoteadministration.AdministrationServer.messageReceived(ppp_mina)
at org.apache.mina.core.filterchain.DefaultIoFilterChain
$TailFilter.messageReceived(ppp_mina)
at
org
.apache
.mina
.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(ppp_mina)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access
$1200(ppp_mina)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl
$1.messageReceived(ppp_mina)
at org.apache.mina.filter.codec.ProtocolCodecFilter
$ProtocolDecoderOutputImpl.flush(ppp_mina)
at
org
.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ppp_mina)
at
org
.apache
.mina
.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(ppp_mina)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access
$1200(ppp_mina)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl
$1.messageReceived(ppp_mina)
at
org
.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(ppp_mina)
at
org
.apache
.mina
.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(ppp_mina)
at
org
.apache
.mina
.core.filterchain.DefaultIoFilterChain.fireMessageReceived(ppp_mina)
at
org.apache.mina.core.polling.AbstractPollingIoProcessor.read(ppp_mina)
at
org
.apache.mina.core.polling.AbstractPollingIoProcessor.process(ppp_mina)
at
org
.apache.mina.core.polling.AbstractPollingIoProcessor.process(ppp_mina)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.access
$400(ppp_mina)
at org.apache.mina.core.polling.AbstractPollingIoProcessor
$Processor.run(ppp_mina)
at org.apache.mina.util.NamePreservingRunnable.run(ppp_mina)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(libgcj.
9.dylib)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(libgcj.9.dylib)
at java.lang.Thread.run(libgcj.9.dylib)
Is there any workaround for the missing function (alternative
implementation)?
I am using gcj version 4.3.3 on Mac OS X.
Thank you very much for any help!
Patrick
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Compiling project using apache mina fails
2009-06-05 14:38 Compiling project using apache mina fails Patrick Schäfer
@ 2009-06-05 15:31 ` Andrew Haley
2009-06-07 18:32 ` Patrick Schäfer
1 sibling, 0 replies; 6+ messages in thread
From: Andrew Haley @ 2009-06-05 15:31 UTC (permalink / raw)
To: Patrick Schäfer; +Cc: java
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Compiling project using apache mina fails
2009-06-05 14:38 Compiling project using apache mina fails Patrick Schäfer
2009-06-05 15:31 ` Andrew Haley
@ 2009-06-07 18:32 ` Patrick Schäfer
2009-06-08 10:05 ` Andrew Haley
1 sibling, 1 reply; 6+ messages in thread
From: Patrick Schäfer @ 2009-06-07 18:32 UTC (permalink / raw)
To: java
hi andrew, thank you for looking into the stacktrace problem anyways!
i have another problem running the code in gcj version 4.3.3 though.
using jdk 1.5 the code runs just fine.
using gcj I receive an exception when trying to access the local
socket port, though the connection has been successfully established
(which I can see on connected machine):
java.lang.IllegalArgumentException: Bad port number: -1
at java.net.InetSocketAddress.<init>(libgcj.9.dylib)
at java.net.Socket.getLocalSocketAddress(libgcj.9.dylib)
at
org
.apache
.mina.transport.socket.nio.NioSocketSession.getLocalAddress(paa_mina)
at
org
.apache
.mina.transport.socket.nio.NioSocketSession.getLocalAddress(paa_mina)
at paa.networklayer.paaClient.getSessionLocalAddress(paa_mina)
is it possible that the local port number isn't stored in libgcj after
connection establishment?
would be great, if you had any idea what could be wrong.
thank you very much
Patrick
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Compiling project using apache mina fails
2009-06-07 18:32 ` Patrick Schäfer
@ 2009-06-08 10:05 ` Andrew Haley
2009-06-08 19:26 ` Patrick Schäfer
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Haley @ 2009-06-08 10:05 UTC (permalink / raw)
To: Patrick Schäfer; +Cc: java
Patrick Schäfer wrote:
> hi andrew, thank you for looking into the stacktrace problem anyways!
>
> i have another problem running the code in gcj version 4.3.3 though.
>
> using jdk 1.5 the code runs just fine.
>
> using gcj I receive an exception when trying to access the local socket
> port, though the connection has been successfully established (which I
> can see on connected machine):
>
> java.lang.IllegalArgumentException: Bad port number: -1
> at java.net.InetSocketAddress.<init>(libgcj.9.dylib)
> at java.net.Socket.getLocalSocketAddress(libgcj.9.dylib)
> at
> org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(paa_mina)
>
> at
> org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(paa_mina)
>
> at paa.networklayer.paaClient.getSessionLocalAddress(paa_mina)
>
> is it possible that the local port number isn't stored in libgcj after
> connection establishment?
>
> would be great, if you had any idea what could be wrong.
If I had a way to look at what was happening I'd just have a look.
I don't know what class the Socket belongs to. At the call to
Socket.getLocalSocketAddress, do something like
println(socket)
println(socket.getClass())
Andrew.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Compiling project using apache mina fails
2009-06-08 10:05 ` Andrew Haley
@ 2009-06-08 19:26 ` Patrick Schäfer
2009-06-08 20:23 ` Andrew Haley
0 siblings, 1 reply; 6+ messages in thread
From: Patrick Schäfer @ 2009-06-08 19:26 UTC (permalink / raw)
To: Andrew Haley; +Cc: java
>>
> If I had a way to look at what was happening I'd just have a look.
thank you for helping again!
> I don't know what class the Socket belongs to. At the call to
> Socket.getLocalSocketAddress, do something like
>
> println(socket)
> println(socket.getClass())
those two calls result in:
println(socket) => gnu.java.nio.NIOSocket@6cff840 [addr=/
10.0.1.194,port=4711,localport=-1]
println(socket.getClass()) => class gnu.java.nio.NIOSocket
The foreign port and ip-address have been set correctly. but the
localport is definitely wrong.
The connection is established on the other machine though. maybe this
port is not stored inside NIOSocket?
thank you
Patrick
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Compiling project using apache mina fails
2009-06-08 19:26 ` Patrick Schäfer
@ 2009-06-08 20:23 ` Andrew Haley
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Haley @ 2009-06-08 20:23 UTC (permalink / raw)
To: Patrick Schäfer; +Cc: java
Patrick Schäfer wrote:
>>>
>> If I had a way to look at what was happening I'd just have a look.
> thank you for helping again!
>
>> I don't know what class the Socket belongs to. At the call to
>> Socket.getLocalSocketAddress, do something like
>>
>> println(socket)
>> println(socket.getClass())
>
> those two calls result in:
>
> println(socket) => gnu.java.nio.NIOSocket@6cff840
> [addr=/10.0.1.194,port=4711,localport=-1]
> println(socket.getClass()) => class gnu.java.nio.NIOSocket
>
> The foreign port and ip-address have been set correctly. but the
> localport is definitely wrong.
> The connection is established on the other machine though. maybe this
> port is not stored inside NIOSocket?
Could be. OK, I now have a better idea what's happening. I'll have a
look tomorrow.
Andrew.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-06-08 20:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-05 14:38 Compiling project using apache mina fails Patrick Schäfer
2009-06-05 15:31 ` Andrew Haley
2009-06-07 18:32 ` Patrick Schäfer
2009-06-08 10:05 ` Andrew Haley
2009-06-08 19:26 ` Patrick Schäfer
2009-06-08 20:23 ` Andrew Haley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).