9 Replies Latest reply on Dec 11, 2002 9:19 PM by joelvogt

    Ping Warnings

    pragneshray


      I scanned thru the whole forum but cannot get help to resolve this problem.

      I keep on getting the following warning on client side

      1717222018 [Connection Monitor Thread] WARN org.jboss.mq.Connection - Connection failure:
      org.jboss.mq.SpyJMSException: Connection Failed; - nested throwable: (java.io.IOException: ping timeout.)
      at org.jboss.mq.Connection.asynchFailure(Connection.java:603)
      at org.jboss.mq.Connection$PingTask.run(Connection.java:1187)
      at EDU.oswego.cs.dl.util.concurrent.ClockDaemon$RunLoop.run(ClockDaemon.java:364)
      at java.lang.Thread.run(Thread.java:484)
      + nested throwable:
      java.io.IOException: ping timeout.
      at org.jboss.mq.Connection$PingTask.run(Connection.java:1179)
      at EDU.oswego.cs.dl.util.concurrent.ClockDaemon$RunLoop.run(ClockDaemon.java:364)
      at java.lang.Thread.run(Thread.java:484)

      It seems that this happens when Jboss is restarted and client does not close the connection cleanly. On the client side i am calling a close, but it seems it is not closing the Connection Monitor Thread.

      I am using Jboss-3.0.3 libs on client side and Jboss-3.0.4 as the server. JDK 1.3

      Any help on this issue is appreciated.

      Thanks

        • 1. Re: Ping Warnings
          joelvogt

          how are you going about closing the connection on the client side?

          • 2. Re: Ping Warnings
            pragneshray

            Here is the code snippet
            ....
            QueueConnection conn;
            QueueSession session;
            ....

            try {
            if (session != null) session.close();
            if (conn != null) {
            conn.stop();
            conn.close();
            }

            } catch(Exception e) {
            }

            • 3. Re: Ping Warnings
              joelvogt

              ok, is this code wrapped in an exception listener or is it at the end of a loop etc?

              • 4. Re: Ping Warnings
                jimvoris

                The ping thread never gets killed on a broken connection, so you get the messages you note above forever.... at least that's what I saw.

                I fixed the problem by killing the ping thread in the circumstance that the connection failed.

                I tried sending the patch to someone on the JMS team, but I'm not sure that it went anywhere, or if I sent it to the right person.

                In any case, I've attached a patched Connection.java (in the org.jboss.mq package in the messaging sub-system).

                Look at line 1171 and the code following that to see what I changed.

                • 5. Re: Ping Warnings
                  pragneshray

                  Its within exception listener.

                  try {
                  ObjectMessage msg = session.createObjectMessage();
                  msg.setObject(event);
                  send.send(msg);

                  } catch(Exception e) {
                  close_Connection(); //got error reset connections
                  }


                  close_Connection()method contains the close session and close connection calls.

                  Thanks

                  • 6. Re: Ping Warnings
                    pragneshray

                    Its within exception listener.

                    try {
                    ObjectMessage msg = session.createObjectMessage();
                    msg.setObject(event);
                    send.send(msg);

                    } catch(Exception e) {
                    close_Connection(); //got error reset connections
                    }


                    close_Connection()method contains the close session and close connection calls.

                    Thanks

                    • 7. Re: Ping Warnings
                      pragneshray

                      Its within exception listener.

                      try {
                      ObjectMessage msg = session.createObjectMessage();
                      msg.setObject(event);
                      send.send(msg);

                      } catch(Exception e) {
                      close_Connection(); //got error reset connections
                      }


                      close_Connection()method contains the close session and close connection calls.

                      Thanks

                      • 8. Re: Ping Warnings
                        pragneshray

                        Exception listener.

                        • 9. Re: Ping Warnings
                          joelvogt

                          try something like

                          public class MyExceptionListener
                          implements javax.jms.ExceptionListener
                          {
                          public void onException(JMSException e)
                          {
                          // Handle the problem here, close etc
                          try
                          {
                          if (session != null)
                          session.close();
                          if (conn != null)
                          {
                          conn.stop();
                          conn.close();
                          }
                          }
                          catch(Exception er)
                          {
                          logCat.error(er);
                          }
                          }
                          }

                          And
                          MyExceptionListener l = new MyExceptionListener();
                          topicConnection.setExceptionListener(l);

                          This should ensure if anything goes wrong with the connection it will be closed cleanly.