1 2 Previous Next 19 Replies Latest reply on Mar 16, 2004 2:15 PM by adrian.brock

    SpyJMSException - Connection Failed - Ping timeout

    softtob

      Hi,

      I have a client that receives messages from a queue.

      When the queue has been inactive after around 24 hours the client looses the connection and reconnects to the server. This works fine but the server keeps saying Connection Failed (Ping timeout) for the previous client connection. This filles up the logfile to grow really huge.

      The exception is:

      11:53:26,796 WARN [Connection] Connection failure:
      org.jboss.mq.SpyJMSException: Connection Failed; - nested throwable: (java.io.IOException: ping timeout.)
      at org.jboss.mq.Connection.asynchFailure(Connection.java:718)
      at org.jboss.mq.Connection$PingTask.run(Connection.java:1311)
      at EDU.oswego.cs.dl.util.concurrent.ClockDaemon$RunLoop.run(ClockDaemon.java:364)
      at java.lang.Thread.run(Thread.java:536)
      Caused by: java.io.IOException: ping timeout.
      at org.jboss.mq.Connection$PingTask.run(Connection.java:1303)


      Why does not the server kill the thread?

      How can I solve this problem?

      Regards,
      SoftTob

        • 1. Re: SpyJMSException - Connection Failed - Ping timeout

          Because you didn't close the connection?

          Regards,
          Adrian

          • 2. Re: SpyJMSException - Connection Failed - Ping timeout
            softtob

            Hi,

            I do close the connection but get this error on the client when doing it...

            org.jboss.mq.SpyJMSException: Cannot close properly the connection; - nested throwable: (java.net.SocketException: Connection reset by peer: socket write error)
            at org.jboss.mq.Connection.close(Connection.java:503)
            at a.b.c.d.e.E$JMSConnectionErrorListener.onException(E.java:680)
            at org.jboss.mq.Connection.asynchFailure(Connection.java:726)
            at org.jboss.mq.Connection$PingTask.run(Connection.java:1311)
            at EDU.oswego.cs.dl.util.concurrent.ClockDaemon$RunLoop.run(ClockDaemon.java:364)
            at java.lang.Thread.run(Thread.java:536)
            Caused by: java.net.SocketException: Connection reset by peer: socket write error
            at java.net.SocketOutputStream.socketWrite0(Native Method)
            at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
            at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
            at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:69)
            at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:127)
            at java.io.ObjectOutputStream$BlockDataOutputStream.flush(ObjectOutputStream.java:1583)
            at java.io.ObjectOutputStream.flush(ObjectOutputStream.java:639)
            at java.io.ObjectOutputStream.close(ObjectOutputStream.java:660)
            at org.jboss.mq.il.oil.OILServerIL.destroyConnection(OILServerIL.java:581)
            at org.jboss.mq.il.oil.OILServerIL.connectionClosing(OILServerIL.java:338)
            at org.jboss.mq.Connection.close(Connection.java:491)
            ... 5 more

            • 3. Re: SpyJMSException - Connection Failed - Ping timeout

              Ah,

              This problem was fixed in 3.0.7
              It was possible for the stopping of the
              ping thread to be bypassed by other errors.

              Regards,
              Adrian

              • 4. Re: SpyJMSException - Connection Failed - Ping timeout
                delboypass

                Hi, Im also having serious problems with this connection failed - Ping error message and we have closed the connection as well.

                THe problem is that we are using the JBoss 3.0.4 version and we are not able to upgrade as it is being used in a deployment. Is there any way to kill it at all???

                Also why is it that the connection timesout.

                We are trying to build an application that can run for extended periods of time so the when we have all hte elements such as hte initial connection, queue session, queue ect... which ones of htese do actually time out and how do you configure so that they dont time out..

                Cheers del.

                • 5. Re: SpyJMSException - Connection Failed - Ping timeout
                  mhemling

                  I'm seeing this same problem in 3.2.1 on Linux with java 1.4.2.

                  I have an Exception Listener that reconnects after JBOSS goes down and comes back up. This works fine except that my ExceptionListener will continue to be called over and over and over with a ping timeout exception. Not sure why.

                  • 6. Re: SpyJMSException - Connection Failed - Ping timeout
                    danhanley

                    We are also seeing the same error with 3.2.2 on windows 2000 pro using java 1.4.1

                    • 7. Re: SpyJMSException - Connection Failed - Ping timeout
                      xibin

                      We are seeing the same problem after upgrading to JBoss 3.2.2. Unfortunately we are not going back to 3.2.1 but this problem need to be solved.

                      We are closing all connections when done, and I have ExceptionListener registered as well.

                      Since it is a WARNING, we could probably turn it off by setting the logging level to be FATAL. However, that does not stop the ClockDaemon's ping task. Does someone has any suggestions?

                      Thanks!

                      • 8. Re: SpyJMSException - Connection Failed - Ping timeout
                        xibin

                        Anybody has any suggestions?

                        • 9. Re: SpyJMSException - Connection Failed - Ping timeout

                          I have met it on jboss3.2.2 and jboss3.2.1, and can't resolve it now. Adrian, can you give some good advice?

                          • 10. Re: SpyJMSException - Connection Failed - Ping timeout

                            Like I said originally, close the connection. That will stop the ping thread.

                            Regards,
                            Adrian

                            • 11. Re: SpyJMSException - Connection Failed - Ping timeout

                              oh, I seems to find my problem. I used a static QueueConnection in my class, and I initialized the connection and other thing, then used it later for every time I want to send message. I thought I can help my performance, and appareantly I was wrong.

                              the pattern to use JMS is just like below:
                              lookup the factory
                              create a connection
                              create a session
                              create a sender
                              send msgs
                              ....
                              close sender
                              close session
                              close connection

                              and I confused I must repeat the step every time.
                              there are some steps that just need to initialize once?

                              • 12. Re: SpyJMSException - Connection Failed - Ping timeout

                                No, you just need to install an ExceptionListener on the connection.
                                When the connection fails, you reinitialize (closing the previous connection).

                                Regards,
                                Adrian

                                • 13. Re: SpyJMSException - Connection Failed - Ping timeout
                                  rviloria

                                  Hi Adrian,

                                  Ive been following this thread and I agree with your suggestions. However when I close my connections my entire receiver terminates. If I dont close the connection using connection.close() and set the session and connection to null, then I have a receiver that IS able to recover when the MQ Server goes down, the receiver stays alive when the MQ server goes down and picks up new messages from the queue correctly ... this is with the reinitialization in my onException(). The only issue is ping timeouts of the other failed connections. So my issue is if I want the receiver to stay up and wait for the MQ to come back up I dont use close(), but my ping timeouts dont get cleaned up.

                                  Can someone point me in the direction for some sample code that demonstrates how a receiver can stay up to reconnect after an MQ goes down AND still clean up the connections causing a ping timeout? I apologize if this is a simple item as Ive seen many similar questions/responses in the forums, but I havent found a straightforward way to accomplish this needed robustness. Thanks for everyone's time.

                                  • 14. Re: SpyJMSException - Connection Failed - Ping timeout
                                    rviloria

                                    I had to extend thread and simply make a sleeping thread in an infinite loop in the background to keep the client alive while I closed the connection. I previously had the problem of closing the connections to stop the constant ping but it exited my app. It may not be the best way but it seems to work for my needs. Thanks!

                                    1 2 Previous Next