1 Reply Latest reply on Apr 16, 2003 1:50 PM by Bruce Ferguson

    ping keeps pinging

    Bruce Ferguson Newbie

      I have a non-EJB application that subscribes to a JMS channel and sets up an ExceptionListener.

      I am trying to make the subscriber reconnect after JBOSS is shutdown and restarted.

      After setting up my connection and subscribing, I kill JBOSS to simulate a problem.

      In the onException message I am doing the following:

      try {
      session.close();
      connection.close();
      }
      catch (Exception e) { e.printStackTrace(); }

      <Get New InitialContext>
      <Lookup ConnectionFactory>
      <Create New Connection>
      <Add new ExceptionListener>
      <Create New Session>
      <Lookup Topic in JNDI>
      <Subscribe to Topic>


      While trying to close the connection and session, I get the following exception:

      org.jboss.mq.SpyJMSException: Cannot unsubscribe to this destination; - nested throwable: (java.net.SocketException: Broken pipe)
      at org.jboss.mq.Connection.removeConsumer(Connection.java:1208)
      at org.jboss.mq.SpySession.removeConsumer(SpySession.java:733)
      at org.jboss.mq.SpyMessageConsumer.close(SpyMessageConsumer.java:417)
      at org.jboss.mq.SpySession.close(SpySession.java:347)
      at JMSTopicSub.disconnect(JMSTopicSub.java:186)
      at JMSTopicSub$MessageHandler.onException(JMSTopicSub.java:64)
      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: Broken pipe
      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 org.jboss.mq.il.oil.OILServerIL.waitAnswer(OILServerIL.java:600)
      at org.jboss.mq.il.oil.OILServerIL.unsubscribe(OILServerIL.java:494)
      at org.jboss.mq.Connection.removeConsumer(Connection.java:1198)
      ... 9 more

      After seeing several ping failure exceptions, I then restart JBOSS.

      The next time onException gets a ping, it runs the code above and CORRECTLY creates the new connections and subscriptions.

      HOWEVER, it appears that the "old connection" is still cached somewhere and continues to send me failed ping messages.

      Any ideas??
      --Bruce Ferguson
      --Pavilion Technologies, Inc.