MINA
  1. MINA
  2. DIRMINA-771

Calling NioSocketSession.toString() causes java.lang.Error

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-RC1
    • Fix Version/s: 2.0.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      WinXP JDK 1.6.1_18

      Description

      Hi there,

      using MINA 2.0.0 RC1 and have a log statement in my IOHandler.exceptionCaught() method plugged on top of a NioSocketSession.
      The log statement calls toString() on the IoSession passed in. In some cases I get the appended Exception.
      Thats not good.

      Regards Jörg

      2010-03-03 09:51:46,818 WARN [NioProcessor-2] filterchain.DefaultIoFilterChain::callNextExceptionCaught() (DefaultIoFilterChain.java:483) - Unexpected exception from exceptionCaught handler. java.lang.Error: java.net.SocketException: Socket operation on nonsocket: getsockname
      at sun.nio.ch.Net.localAddress(Net.java:125)
      at sun.nio.ch.SocketChannelImpl.localAddress(SocketChannelImpl.java:430)
      at sun.nio.ch.SocketAdaptor.getLocalAddress(SocketAdaptor.java:147)
      at java.net.Socket.getLocalSocketAddress(Socket.java:703)
      at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:158)
      at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:47)
      at org.apache.mina.core.session.AbstractIoSession.toString(AbstractIoSession.java:1139)
      at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.MinaCecsIoHandler.exceptionCaught(MinaCecsIoHandler.java:33)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.exceptionCaught(DefaultIoFilterChain.java:694)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:480)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1100(DefaultIoFilterChain.java:46)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.exceptionCaught(DefaultIoFilterChain.java:788)
      at org.apache.mina.core.filterchain.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:111)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:480)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireExceptionCaught(DefaultIoFilterChain.java:468)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:397)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:778)
      at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:778)
      at org.apache.mina.filter.codec.ProtocolCodecFilter.sessionClosed(ProtocolCodecFilter.java:345)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:778)
      at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionClosed(DefaultIoFilterChain.java:388)
      at org.apache.mina.core.service.IoServiceListenerSupport.fireSessionDestroyed(IoServiceListenerSupport.java:210)
      at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeNow(AbstractPollingIoProcessor.java:535)
      at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeSessions(AbstractPollingIoProcessor.java:497)
      at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:61)
      at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:974)
      at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.net.SocketException: Socket operation on nonsocket: getsockname
      at sun.nio.ch.Net.localInetAddress(Native Method)
      at sun.nio.ch.Net.localAddress(Net.java:122) ... 37 more

        Issue Links

          Activity

          Hide
          Jörg Michelberger added a comment -

          Get the same exception in sessionClosed() in some reasons by calling toString() on the session.

          Show
          Jörg Michelberger added a comment - Get the same exception in sessionClosed() in some reasons by calling toString() on the session.
          Hide
          Jörg Michelberger added a comment -

          Seems that logging the session (toString()) is a deadly operation. Get it again in onPostRemove().

          Show
          Jörg Michelberger added a comment - Seems that logging the session (toString()) is a deadly operation. Get it again in onPostRemove().
          Hide
          Emmanuel Lecharny added a comment -

          This can certainly be improved. The stack trace is generated because for some reason, we try to get the localAddress, and it's already closed.

          However, this is not really a critical error.

          Show
          Emmanuel Lecharny added a comment - This can certainly be improved. The stack trace is generated because for some reason, we try to get the localAddress, and it's already closed. However, this is not really a critical error.
          Hide
          Emmanuel Lecharny added a comment -

          To be fixed in 2.0.0

          Show
          Emmanuel Lecharny added a comment - To be fixed in 2.0.0
          Hide
          Emmanuel Lecharny added a comment -

          It seems to have been fixed in rev 785102 : http://svn.apache.org/viewvc?view=revision&revision=785102, so before 2.0.0-RC1.

          I find it very strange that some stackTrace are present when we catch all the exceptions instead of propagating them.

          Is it possible hat you tested with an older version ?

          Show
          Emmanuel Lecharny added a comment - It seems to have been fixed in rev 785102 : http://svn.apache.org/viewvc?view=revision&revision=785102 , so before 2.0.0-RC1. I find it very strange that some stackTrace are present when we catch all the exceptions instead of propagating them. Is it possible hat you tested with an older version ?
          Hide
          Emmanuel Lecharny added a comment -

          Postponed to 2.0.1

          Show
          Emmanuel Lecharny added a comment - Postponed to 2.0.1
          Hide
          Emmanuel Lecharny added a comment -

          To me, the problem has already fixed a long time ago : if the localAddress is closed, we won't get an Exception, but a message indicating that "Session is disconnecting ..."

          Show
          Emmanuel Lecharny added a comment - To me, the problem has already fixed a long time ago : if the localAddress is closed, we won't get an Exception, but a message indicating that "Session is disconnecting ..."
          Hide
          Emmanuel Lecharny added a comment -

          Closing issues

          Show
          Emmanuel Lecharny added a comment - Closing issues
          Hide
          Jörg Michelberger added a comment -

          This issue is still in 2.0.2.
          Calling NioSocketSession.toString() in all MINA callbacks can lead to Exceptions.
          Found it still in 2.0.2 in IoFutureListener<CloseFuture>.operationComplete(final CloseFuture f) registered to closeFuture, IoSessionInitializer<ConnectFuture>.initializeSession() callback, IoFutureListener<ConnectFuture>.operationComplete(final ConnectFuture f) and IoHandlerAdapter extension in all callbacks. I have multiple client connections via a low bandwidth satellite link to multiple servers. Established connections are often closed by counterpart server, before initializeSession is completed/started, or during messages are sent or received. I implemented also a reconnection mode, which initiates a immediate NIOSocketConnector.connect after connection is broken. This works fine for a while, but NioSocketConnector thread stops performing connects on TCP/IP level on a while. Connects are then lost in MINA and the corresponding connect future listener is never called...Automatic stoped. Do you have any idea about this issue...

          Show
          Jörg Michelberger added a comment - This issue is still in 2.0.2. Calling NioSocketSession.toString() in all MINA callbacks can lead to Exceptions. Found it still in 2.0.2 in IoFutureListener<CloseFuture>.operationComplete(final CloseFuture f) registered to closeFuture, IoSessionInitializer<ConnectFuture>.initializeSession() callback, IoFutureListener<ConnectFuture>.operationComplete(final ConnectFuture f) and IoHandlerAdapter extension in all callbacks. I have multiple client connections via a low bandwidth satellite link to multiple servers. Established connections are often closed by counterpart server, before initializeSession is completed/started, or during messages are sent or received. I implemented also a reconnection mode, which initiates a immediate NIOSocketConnector.connect after connection is broken. This works fine for a while, but NioSocketConnector thread stops performing connects on TCP/IP level on a while. Connects are then lost in MINA and the corresponding connect future listener is never called...Automatic stoped. Do you have any idea about this issue...
          Hide
          Emmanuel Lecharny added a comment -

          I double checked the NioSocketSession.toString() method, and I don't really see how we can have some NPE. We will swallow it in the toString() metho :

          public String toString() {
          if (isConnected() || isClosing()) {
          try {
          SocketAddress remote = getRemoteAddress();
          SocketAddress local = getLocalAddress();

          if (getService() instanceof IoAcceptor)

          { return "(" + getIdAsString() + ": " + getServiceName() + ", server, " + remote + " => " + local + ')'; }

          return "(" + getIdAsString() + ": " + getServiceName() + ", client, " + local + " => " + remote + ')';
          } catch (Exception e)

          { return "Session is disconnecting ..."; }

          }

          return "Session disconnected ...";
          }

          Do you have any stacktrace ?

          Show
          Emmanuel Lecharny added a comment - I double checked the NioSocketSession.toString() method, and I don't really see how we can have some NPE. We will swallow it in the toString() metho : public String toString() { if (isConnected() || isClosing()) { try { SocketAddress remote = getRemoteAddress(); SocketAddress local = getLocalAddress(); if (getService() instanceof IoAcceptor) { return "(" + getIdAsString() + ": " + getServiceName() + ", server, " + remote + " => " + local + ')'; } return "(" + getIdAsString() + ": " + getServiceName() + ", client, " + local + " => " + remote + ')'; } catch (Exception e) { return "Session is disconnecting ..."; } } return "Session disconnected ..."; } Do you have any stacktrace ?
          Hide
          Jörg Michelberger added a comment -

          I build a IoSessionUtil.toString(ioSession) static method to fetch all the exceptions. Here is the first. More follows...
          java.lang.Error: java.net.SocketException: Socket operation on nonsocket: getsockname
          at sun.nio.ch.Net.localAddress(Net.java:128)
          at sun.nio.ch.SocketChannelImpl.localAddress(SocketChannelImpl.java:423)
          at sun.nio.ch.SocketAdaptor.getLocalAddress(SocketAdaptor.java:147)
          at java.net.Socket.getLocalSocketAddress(Socket.java:717)
          at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:112)
          at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:43)
          at org.apache.mina.core.session.AbstractIoSession.toString(AbstractIoSession.java:1201)
          at java.lang.String.valueOf(String.java:2826)
          at java.lang.StringBuilder.append(StringBuilder.java:115)
          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.IoSessionUtil.toString(IoSessionUtil.java:36)
          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.Sessions$DisconnectListener.operationComplete(Sessions.java:319)
          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.Sessions$DisconnectListener.operationComplete(Sessions.java:292)
          at org.apache.mina.core.future.DefaultIoFuture.notifyListener(DefaultIoFuture.java:377)
          at org.apache.mina.core.future.DefaultIoFuture.notifyListeners(DefaultIoFuture.java:367)
          at org.apache.mina.core.future.DefaultIoFuture.setValue(DefaultIoFuture.java:290)
          at org.apache.mina.core.future.DefaultCloseFuture.setClosed(DefaultCloseFuture.java:47)
          at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionClosed(DefaultIoFilterChain.java:381)
          at org.apache.mina.core.service.IoServiceListenerSupport.fireSessionDestroyed(IoServiceListenerSupport.java:244)
          at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeNow(AbstractPollingIoProcessor.java:580)
          at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeSessions(AbstractPollingIoProcessor.java:540)
          at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67)
          at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1087)
          at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:662)
          Caused by: java.net.SocketException: Socket operation on nonsocket: getsockname
          at sun.nio.ch.Net.localInetAddress(Native Method)
          at sun.nio.ch.Net.localAddress(Net.java:125)
          ... 25 more

          Show
          Jörg Michelberger added a comment - I build a IoSessionUtil.toString(ioSession) static method to fetch all the exceptions. Here is the first. More follows... java.lang.Error: java.net.SocketException: Socket operation on nonsocket: getsockname at sun.nio.ch.Net.localAddress(Net.java:128) at sun.nio.ch.SocketChannelImpl.localAddress(SocketChannelImpl.java:423) at sun.nio.ch.SocketAdaptor.getLocalAddress(SocketAdaptor.java:147) at java.net.Socket.getLocalSocketAddress(Socket.java:717) at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:112) at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:43) at org.apache.mina.core.session.AbstractIoSession.toString(AbstractIoSession.java:1201) at java.lang.String.valueOf(String.java:2826) at java.lang.StringBuilder.append(StringBuilder.java:115) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.IoSessionUtil.toString(IoSessionUtil.java:36) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.Sessions$DisconnectListener.operationComplete(Sessions.java:319) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.Sessions$DisconnectListener.operationComplete(Sessions.java:292) at org.apache.mina.core.future.DefaultIoFuture.notifyListener(DefaultIoFuture.java:377) at org.apache.mina.core.future.DefaultIoFuture.notifyListeners(DefaultIoFuture.java:367) at org.apache.mina.core.future.DefaultIoFuture.setValue(DefaultIoFuture.java:290) at org.apache.mina.core.future.DefaultCloseFuture.setClosed(DefaultCloseFuture.java:47) at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionClosed(DefaultIoFilterChain.java:381) at org.apache.mina.core.service.IoServiceListenerSupport.fireSessionDestroyed(IoServiceListenerSupport.java:244) at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeNow(AbstractPollingIoProcessor.java:580) at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeSessions(AbstractPollingIoProcessor.java:540) at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67) at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1087) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.net.SocketException: Socket operation on nonsocket: getsockname at sun.nio.ch.Net.localInetAddress(Native Method) at sun.nio.ch.Net.localAddress(Net.java:125) ... 25 more
          Hide
          Jörg Michelberger added a comment -

          Next:
          java.lang.Error: java.net.SocketException: Socket operation on nonsocket: getsockname

          at sun.nio.ch.Net.localAddress(Net.java:128)

          at sun.nio.ch.SocketChannelImpl.localAddress(SocketChannelImpl.java:423)

          at sun.nio.ch.SocketAdaptor.getLocalAddress(SocketAdaptor.java:147)

          at java.net.Socket.getLocalSocketAddress(Socket.java:717)

          at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:112)

          at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:43)

          at org.apache.mina.core.session.AbstractIoSession.toString(AbstractIoSession.java:1201)

          at java.lang.String.valueOf(String.java:2826)

          at java.lang.StringBuilder.append(StringBuilder.java:115)

          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.IoSessionUtil.toString(IoSessionUtil.java:36)

          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.MinaCecsIoHandler.sessionClosed(MinaCecsIoHandler.java:73)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.sessionClosed(DefaultIoFilterChain.java:665)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)

          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.ThroughputCounterFilter.sessionClosed(ThroughputCounterFilter.java:28)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.filter.codec.ProtocolCodecFilter.sessionClosed(ProtocolCodecFilter.java:387)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)

          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.ConnectionLoggingFilter.sessionClosed(ConnectionLoggingFilter.java:48)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionClosed(DefaultIoFilterChain.java:388)

          at org.apache.mina.core.service.IoServiceListenerSupport.fireSessionDestroyed(IoServiceListenerSupport.java:244)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeNow(AbstractPollingIoProcessor.java:580)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeSessions(AbstractPollingIoProcessor.java:540)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1087)

          at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:662)

          Caused by: java.net.SocketException: Socket operation on nonsocket: getsockname

          at sun.nio.ch.Net.localInetAddress(Native Method)

          at sun.nio.ch.Net.localAddress(Net.java:125)

          ... 48 more

          Show
          Jörg Michelberger added a comment - Next: java.lang.Error: java.net.SocketException: Socket operation on nonsocket: getsockname at sun.nio.ch.Net.localAddress(Net.java:128) at sun.nio.ch.SocketChannelImpl.localAddress(SocketChannelImpl.java:423) at sun.nio.ch.SocketAdaptor.getLocalAddress(SocketAdaptor.java:147) at java.net.Socket.getLocalSocketAddress(Socket.java:717) at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:112) at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:43) at org.apache.mina.core.session.AbstractIoSession.toString(AbstractIoSession.java:1201) at java.lang.String.valueOf(String.java:2826) at java.lang.StringBuilder.append(StringBuilder.java:115) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.IoSessionUtil.toString(IoSessionUtil.java:36) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.MinaCecsIoHandler.sessionClosed(MinaCecsIoHandler.java:73) at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.sessionClosed(DefaultIoFilterChain.java:665) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.ThroughputCounterFilter.sessionClosed(ThroughputCounterFilter.java:28) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.filter.codec.ProtocolCodecFilter.sessionClosed(ProtocolCodecFilter.java:387) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.ConnectionLoggingFilter.sessionClosed(ConnectionLoggingFilter.java:48) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionClosed(DefaultIoFilterChain.java:388) at org.apache.mina.core.service.IoServiceListenerSupport.fireSessionDestroyed(IoServiceListenerSupport.java:244) at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeNow(AbstractPollingIoProcessor.java:580) at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeSessions(AbstractPollingIoProcessor.java:540) at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67) at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1087) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.net.SocketException: Socket operation on nonsocket: getsockname at sun.nio.ch.Net.localInetAddress(Native Method) at sun.nio.ch.Net.localAddress(Net.java:125) ... 48 more
          Hide
          Jörg Michelberger added a comment -

          One more:
          java.lang.Error: java.net.SocketException: Socket operation on nonsocket: getsockname

          at sun.nio.ch.Net.localAddress(Net.java:128)

          at sun.nio.ch.SocketChannelImpl.localAddress(SocketChannelImpl.java:423)

          at sun.nio.ch.SocketAdaptor.getLocalAddress(SocketAdaptor.java:147)

          at java.net.Socket.getLocalSocketAddress(Socket.java:717)

          at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:112)

          at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:43)

          at org.apache.mina.core.session.AbstractIoSession.toString(AbstractIoSession.java:1201)

          at java.lang.String.valueOf(String.java:2826)

          at java.lang.StringBuilder.append(StringBuilder.java:115)

          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.IoSessionUtil.toString(IoSessionUtil.java:36)

          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.KeepAliveFilter.resetStatus(KeepAliveFilter.java:271)

          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.KeepAliveFilter.onPostRemove(KeepAliveFilter.java:142)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.deregister(DefaultIoFilterChain.java:309)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.clear(DefaultIoFilterChain.java:264)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.sessionClosed(DefaultIoFilterChain.java:675)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)

          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.ThroughputCounterFilter.sessionClosed(ThroughputCounterFilter.java:28)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.filter.codec.ProtocolCodecFilter.sessionClosed(ProtocolCodecFilter.java:387)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)

          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.ConnectionLoggingFilter.sessionClosed(ConnectionLoggingFilter.java:48)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionClosed(DefaultIoFilterChain.java:388)

          at org.apache.mina.core.service.IoServiceListenerSupport.fireSessionDestroyed(IoServiceListenerSupport.java:244)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeNow(AbstractPollingIoProcessor.java:580)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeSessions(AbstractPollingIoProcessor.java:540)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1087)

          at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:662)

          Caused by: java.net.SocketException: Socket operation on nonsocket: getsockname

          at sun.nio.ch.Net.localInetAddress(Native Method)

          at sun.nio.ch.Net.localAddress(Net.java:125)

          ... 51 more

          Show
          Jörg Michelberger added a comment - One more: java.lang.Error: java.net.SocketException: Socket operation on nonsocket: getsockname at sun.nio.ch.Net.localAddress(Net.java:128) at sun.nio.ch.SocketChannelImpl.localAddress(SocketChannelImpl.java:423) at sun.nio.ch.SocketAdaptor.getLocalAddress(SocketAdaptor.java:147) at java.net.Socket.getLocalSocketAddress(Socket.java:717) at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:112) at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:43) at org.apache.mina.core.session.AbstractIoSession.toString(AbstractIoSession.java:1201) at java.lang.String.valueOf(String.java:2826) at java.lang.StringBuilder.append(StringBuilder.java:115) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.IoSessionUtil.toString(IoSessionUtil.java:36) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.KeepAliveFilter.resetStatus(KeepAliveFilter.java:271) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.KeepAliveFilter.onPostRemove(KeepAliveFilter.java:142) at org.apache.mina.core.filterchain.DefaultIoFilterChain.deregister(DefaultIoFilterChain.java:309) at org.apache.mina.core.filterchain.DefaultIoFilterChain.clear(DefaultIoFilterChain.java:264) at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.sessionClosed(DefaultIoFilterChain.java:675) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.ThroughputCounterFilter.sessionClosed(ThroughputCounterFilter.java:28) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.filter.codec.ProtocolCodecFilter.sessionClosed(ProtocolCodecFilter.java:387) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.ConnectionLoggingFilter.sessionClosed(ConnectionLoggingFilter.java:48) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionClosed(DefaultIoFilterChain.java:388) at org.apache.mina.core.service.IoServiceListenerSupport.fireSessionDestroyed(IoServiceListenerSupport.java:244) at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeNow(AbstractPollingIoProcessor.java:580) at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeSessions(AbstractPollingIoProcessor.java:540) at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67) at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1087) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.net.SocketException: Socket operation on nonsocket: getsockname at sun.nio.ch.Net.localInetAddress(Native Method) at sun.nio.ch.Net.localAddress(Net.java:125) ... 51 more
          Hide
          Jörg Michelberger added a comment -

          Maby same as previous...
          java.lang.Error: java.net.SocketException: Socket operation on nonsocket: getsockname

          at sun.nio.ch.Net.localAddress(Net.java:128)

          at sun.nio.ch.SocketChannelImpl.localAddress(SocketChannelImpl.java:423)

          at sun.nio.ch.SocketAdaptor.getLocalAddress(SocketAdaptor.java:147)

          at java.net.Socket.getLocalSocketAddress(Socket.java:717)

          at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:112)

          at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:43)

          at org.apache.mina.core.session.AbstractIoSession.toString(AbstractIoSession.java:1201)

          at java.lang.String.valueOf(String.java:2826)

          at java.lang.StringBuilder.append(StringBuilder.java:115)

          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.IoSessionUtil.toString(IoSessionUtil.java:36)

          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.compression.CompressionFilter.onPostRemove(CompressionFilter.java:250)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.deregister(DefaultIoFilterChain.java:309)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.clear(DefaultIoFilterChain.java:264)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.sessionClosed(DefaultIoFilterChain.java:675)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)

          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.ThroughputCounterFilter.sessionClosed(ThroughputCounterFilter.java:28)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.filter.codec.ProtocolCodecFilter.sessionClosed(ProtocolCodecFilter.java:387)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)

          at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.ConnectionLoggingFilter.sessionClosed(ConnectionLoggingFilter.java:48)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781)

          at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395)

          at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionClosed(DefaultIoFilterChain.java:388)

          at org.apache.mina.core.service.IoServiceListenerSupport.fireSessionDestroyed(IoServiceListenerSupport.java:244)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeNow(AbstractPollingIoProcessor.java:580)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeSessions(AbstractPollingIoProcessor.java:540)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67)

          at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1087)

          at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:662)

          Caused by: java.net.SocketException: Socket operation on nonsocket: getsockname

          at sun.nio.ch.Net.localInetAddress(Native Method)

          at sun.nio.ch.Net.localAddress(Net.java:125)

          ... 50 more

          Show
          Jörg Michelberger added a comment - Maby same as previous... java.lang.Error: java.net.SocketException: Socket operation on nonsocket: getsockname at sun.nio.ch.Net.localAddress(Net.java:128) at sun.nio.ch.SocketChannelImpl.localAddress(SocketChannelImpl.java:423) at sun.nio.ch.SocketAdaptor.getLocalAddress(SocketAdaptor.java:147) at java.net.Socket.getLocalSocketAddress(Socket.java:717) at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:112) at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:43) at org.apache.mina.core.session.AbstractIoSession.toString(AbstractIoSession.java:1201) at java.lang.String.valueOf(String.java:2826) at java.lang.StringBuilder.append(StringBuilder.java:115) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.IoSessionUtil.toString(IoSessionUtil.java:36) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.compression.CompressionFilter.onPostRemove(CompressionFilter.java:250) at org.apache.mina.core.filterchain.DefaultIoFilterChain.deregister(DefaultIoFilterChain.java:309) at org.apache.mina.core.filterchain.DefaultIoFilterChain.clear(DefaultIoFilterChain.java:264) at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.sessionClosed(DefaultIoFilterChain.java:675) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.ThroughputCounterFilter.sessionClosed(ThroughputCounterFilter.java:28) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.filter.codec.ProtocolCodecFilter.sessionClosed(ProtocolCodecFilter.java:387) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95) at com.ndsatcom.cecsdatamodel.cecsclient.newmulti.mina.ConnectionLoggingFilter.sessionClosed(ConnectionLoggingFilter.java:48) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:46) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:781) at org.apache.mina.core.filterchain.IoFilterAdapter.sessionClosed(IoFilterAdapter.java:95) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:395) at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionClosed(DefaultIoFilterChain.java:388) at org.apache.mina.core.service.IoServiceListenerSupport.fireSessionDestroyed(IoServiceListenerSupport.java:244) at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeNow(AbstractPollingIoProcessor.java:580) at org.apache.mina.core.polling.AbstractPollingIoProcessor.removeSessions(AbstractPollingIoProcessor.java:540) at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67) at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1087) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.net.SocketException: Socket operation on nonsocket: getsockname at sun.nio.ch.Net.localInetAddress(Native Method) at sun.nio.ch.Net.localAddress(Net.java:125) ... 50 more
          Hide
          Emmanuel Lecharny added a comment -

          Thanks.

          In all those StackTrace, we can see that the exception is generated because the socket has been closed. Those exception are expected.

          What I'm saying is that these exceptions are caught in the toString() method, and not propagated :
          try

          { SocketAddress remote = getRemoteAddress(); SocketAddress local = getLocalAddress(); ... }

          catch (Exception e)

          { return "Session is disconnecting ..."; }

          So what exactly is the problem?

          Show
          Emmanuel Lecharny added a comment - Thanks. In all those StackTrace, we can see that the exception is generated because the socket has been closed. Those exception are expected. What I'm saying is that these exceptions are caught in the toString() method, and not propagated : try { SocketAddress remote = getRemoteAddress(); SocketAddress local = getLocalAddress(); ... } catch (Exception e) { return "Session is disconnecting ..."; } So what exactly is the problem?
          Hide
          Jörg Michelberger added a comment -

          Thanks for your quick answer.
          Ok, your right, thats what I want to have. A more robust implementation of toString().
          But in any exceptional case toString() should return as much information as possible.
          Minimum your disconnecting hint and the id string.
          Local and remote address getter should get its own try catch block in toString.
          Catching Exception is not enough. There is java.lang.Error in the stack traces, which is a Throwable.class as Exception.class is. Your proposed catch code doesn't fit to that what really is thrown and the thrown java.lang.Error bypasses your try-catch attempt.

          Show
          Jörg Michelberger added a comment - Thanks for your quick answer. Ok, your right, thats what I want to have. A more robust implementation of toString(). But in any exceptional case toString() should return as much information as possible. Minimum your disconnecting hint and the id string. Local and remote address getter should get its own try catch block in toString. Catching Exception is not enough. There is java.lang.Error in the stack traces, which is a Throwable.class as Exception.class is. Your proposed catch code doesn't fit to that what really is thrown and the thrown java.lang.Error bypasses your try-catch attempt.
          Hide
          Emmanuel Lecharny added a comment -

          Ok, get it.

          Will provide a fix asap.

          Show
          Emmanuel Lecharny added a comment - Ok, get it. Will provide a fix asap.
          Hide
          Emmanuel Lecharny added a comment -

          Is somethng like :

          public String toString() {
          if (isConnected() || isClosing()) {
          SocketAddress remote = null;
          SocketAddress local = null;

          try

          { remote = getRemoteAddress(); }

          catch ( Throwable t )

          { return "Cannot get the remote address informations : " + t.getMessage(); }

          try

          { local = getLocalAddress(); }

          catch ( Throwable t )

          { return "Cannot get the local address informations : " + t.getMessage(); }

          if (getService() instanceof IoAcceptor)

          { return "(" + getIdAsString() + ": " + getServiceName() + ", server, " + remote + " => " + local + ')'; }

          return "(" + getIdAsString() + ": " + getServiceName() + ", client, " + local + " => " + remote + ')';
          }

          return "Session disconnected ...";
          }

          good enough ?

          Show
          Emmanuel Lecharny added a comment - Is somethng like : public String toString() { if (isConnected() || isClosing()) { SocketAddress remote = null; SocketAddress local = null; try { remote = getRemoteAddress(); } catch ( Throwable t ) { return "Cannot get the remote address informations : " + t.getMessage(); } try { local = getLocalAddress(); } catch ( Throwable t ) { return "Cannot get the local address informations : " + t.getMessage(); } if (getService() instanceof IoAcceptor) { return "(" + getIdAsString() + ": " + getServiceName() + ", server, " + remote + " => " + local + ')'; } return "(" + getIdAsString() + ": " + getServiceName() + ", client, " + local + " => " + remote + ')'; } return "Session disconnected ..."; } good enough ?
          Hide
          Jörg Michelberger added a comment -

          Good proposal.
          What do you think about..

          @Override
          public String toString() {
          if (isConnected() || isClosing()) {
          String remote;
          String local;

          try

          { remote = String.valueOf(getRemoteAddress()); }

          catch ( Throwable t )

          { remote = "Cannot get the remote address informations: " + t.getMessage(); }

          try

          { local = String.valueOf(getLocalAddress()); }

          catch ( Throwable t )

          { local = "Cannot get the local address informations: " + t.getMessage(); }

          if (getService() instanceof IoAcceptor)

          { return "(" + getIdAsString() + ": " + getServiceName() + ", server, " + remote + " => " + local + ')'; }

          return "(" + getIdAsString() + ": " + getServiceName() + ", client, " + local + " => " + remote + ')';
          }

          return "(" + getIdAsString() + ") Session disconnected ...";
          }

          I didn't compile it but it should provide in all cases as much information as possible to identify the session in a log file.

          Show
          Jörg Michelberger added a comment - Good proposal. What do you think about.. @Override public String toString() { if (isConnected() || isClosing()) { String remote; String local; try { remote = String.valueOf(getRemoteAddress()); } catch ( Throwable t ) { remote = "Cannot get the remote address informations: " + t.getMessage(); } try { local = String.valueOf(getLocalAddress()); } catch ( Throwable t ) { local = "Cannot get the local address informations: " + t.getMessage(); } if (getService() instanceof IoAcceptor) { return "(" + getIdAsString() + ": " + getServiceName() + ", server, " + remote + " => " + local + ')'; } return "(" + getIdAsString() + ": " + getServiceName() + ", client, " + local + " => " + remote + ')'; } return "(" + getIdAsString() + ") Session disconnected ..."; } I didn't compile it but it should provide in all cases as much information as possible to identify the session in a log file.
          Hide
          Francesco Vivoli added a comment -

          Hi there

          I'm using 2.0.2 and I think I'm getting the same trace here...

          21/03/2011 11:06:54,515 ERROR - BioPingTask-BioReaderPingTask.run:30 - Errore durante l'esecuzione del task
          java.lang.Error: java.net.SocketException: Socket operation on nonsocket: getsockname
          at sun.nio.ch.Net.localAddress(Net.java:128)
          at sun.nio.ch.SocketChannelImpl.localAddress(SocketChannelImpl.java:430)
          at sun.nio.ch.SocketAdaptor.getLocalAddress(SocketAdaptor.java:147)
          at java.net.Socket.getLocalSocketAddress(Socket.java:717)
          at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:112)
          at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:43)
          at org.apache.mina.core.session.AbstractIoSession.toString(AbstractIoSession.java:1201)
          at java.lang.String.valueOf(String.java:2826)
          at java.lang.StringBuffer.append(StringBuffer.java:219)
          at org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:141)
          at org.slf4j.helpers.MessageFormatter.format(MessageFormatter.java:67)
          at org.slf4j.impl.Log4jLoggerAdapter.debug(Log4jLoggerAdapter.java:188)
          at it.loginet.petrol.devices.bio.BioManagementIoHandler.send(BioManagementIoHandler.java:114)
          at it.loginet.petrol.devices.bio.BioReader.sendPing(BioReader.java:130)
          at it.loginet.petrol.devices.bio.BioReaderPingTask.txRun(BioReaderPingTask.java:16)
          at it.loginet.petrol.infrastructure.TransactionalTimerTask.run(TransactionalTimerTask.java:27)
          at java.util.TimerThread.mainLoop(Timer.java:512)
          at java.util.TimerThread.run(Timer.java:462)
          Caused by: java.net.SocketException: Socket operation on nonsocket: getsockname
          at sun.nio.ch.Net.localInetAddress(Native Method)
          at sun.nio.ch.Net.localAddress(Net.java:125)
          ... 17 more

          It only appears when I activate debugging on this class so it's not much of a critical problem but still, unconvenient at best.
          Is this issue fixed on 2.0.2? looking at its state it seems not.

          Show
          Francesco Vivoli added a comment - Hi there I'm using 2.0.2 and I think I'm getting the same trace here... 21/03/2011 11:06:54,515 ERROR - BioPingTask-BioReaderPingTask.run:30 - Errore durante l'esecuzione del task java.lang.Error: java.net.SocketException: Socket operation on nonsocket: getsockname at sun.nio.ch.Net.localAddress(Net.java:128) at sun.nio.ch.SocketChannelImpl.localAddress(SocketChannelImpl.java:430) at sun.nio.ch.SocketAdaptor.getLocalAddress(SocketAdaptor.java:147) at java.net.Socket.getLocalSocketAddress(Socket.java:717) at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:112) at org.apache.mina.transport.socket.nio.NioSocketSession.getLocalAddress(NioSocketSession.java:43) at org.apache.mina.core.session.AbstractIoSession.toString(AbstractIoSession.java:1201) at java.lang.String.valueOf(String.java:2826) at java.lang.StringBuffer.append(StringBuffer.java:219) at org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:141) at org.slf4j.helpers.MessageFormatter.format(MessageFormatter.java:67) at org.slf4j.impl.Log4jLoggerAdapter.debug(Log4jLoggerAdapter.java:188) at it.loginet.petrol.devices.bio.BioManagementIoHandler.send(BioManagementIoHandler.java:114) at it.loginet.petrol.devices.bio.BioReader.sendPing(BioReader.java:130) at it.loginet.petrol.devices.bio.BioReaderPingTask.txRun(BioReaderPingTask.java:16) at it.loginet.petrol.infrastructure.TransactionalTimerTask.run(TransactionalTimerTask.java:27) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) Caused by: java.net.SocketException: Socket operation on nonsocket: getsockname at sun.nio.ch.Net.localInetAddress(Native Method) at sun.nio.ch.Net.localAddress(Net.java:125) ... 17 more It only appears when I activate debugging on this class so it's not much of a critical problem but still, unconvenient at best. Is this issue fixed on 2.0.2? looking at its state it seems not.
          Hide
          Emmanuel Lecharny added a comment -

          The patch was wrongly associated to DIRMINA-816. Fixed with http://svn.apache.org/viewvc?view=revision&revision=1069906

          Show
          Emmanuel Lecharny added a comment - The patch was wrongly associated to DIRMINA-816 . Fixed with http://svn.apache.org/viewvc?view=revision&revision=1069906

            People

            • Assignee:
              Unassigned
              Reporter:
              Jörg Michelberger
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development