0 Replies Latest reply on Sep 27, 2013 5:27 AM by 亚风 史

    javax.jms.JMSException: Timed out waiting for response when sending packet 71

    亚风 史 Newbie

      Hi,

      I am getting the below Exception after a couple of hours of running our application using HornetQ 2.1.2.final

      javax.jms.JMSException: Timed out waiting for response when sending packet 71

      at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:277)

      at org.hornetq.core.client.impl.ClientProducerImpl.doSend(ClientProducerImpl.java:285)

      at org.hornetq.core.client.impl.ClientProducerImpl.send(ClientProducerImpl.java:139)

      at org.hornetq.jms.client.HornetQMessageProducer.doSend(HornetQMessageProducer.java:451)

      at org.hornetq.jms.client.HornetQMessageProducer.send(HornetQMessageProducer.java:199)

      at com.ustcinfo.hornetqclient.SenderTopic.run(SenderTopic.java:40)

      at com.ustcinfo.hornetqclient.SenderTopic.main(SenderTopic.java:18)

      Caused by: HornetQException[errorCode=3 message=Timed out waiting for response when sending packet 71]

      ... 7 more

       

      and this is our test java code:

       

      public class SenderTopic  {
        public static void main(String[] args) throws Exception {
         new SenderTopic().run();
        }
        private void run() throws Exception {
         Properties props = new Properties();
         props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
         props.put(Context.PROVIDER_URL, "jnp://134.64.110.91:2099");
         InitialContext initContext = null;
         Topic topic  = null;
         ConnectionFactory cf = null;
         initContext = new InitialContext(props);
         topic = (Topic) initContext.lookup("/topic/ExampleTopic");
         cf = (ConnectionFactory) initContext.lookup("/ConnectionFactory");
         Connection connection = null;
         try {
          connection = cf.createConnection();
          Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
          MessageProducer producer = session.createProducer(topic);
          TextMessage msg = session.createTextMessage("bbbbbbb");
          producer.send(msg);
          } catch (JMSException e) {
           e.printStackTrace();
         } finally {
          if(connection != null) {
           try {
            connection.close();
           } catch (JMSException e) {
            connection = null;
           }
          }
         }
        }
      }

      Thank you!

      史亚风