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:
> 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.
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.