title: SocketException in ActiveMQ when exiting listener application
body: <p>I am currently setting up a Tomcat Server that is running an embedded ActiveMQ broker.  I'm using Spring to configure JMS.  I wrote a test application to listen to topics and when I exit the test application the ActiveMQ broker throws a SocketException.  Here is the exception:</p>
  
  <pre><code>2009-06-09 13:12:48,005 DEBUG Transport:229 - Transport failed: java.net.SocketException: Connection reset
  java.net.SocketException: Connection reset
          at java.net.SocketInputStream.read(SocketInputStream.java:168)
          at org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:50)
          at org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:58)
          at java.io.DataInputStream.readInt(DataInputStream.java:370)
          at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:269)
          at org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:210)
          at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:202)
          at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:185)
          at java.lang.Thread.run(Thread.java:619)
  </code></pre>
  
  <p>My test application just loads the context xml file, loops sleeps every 60 seconds.  </p>
  
  <pre><code>public static void main(String[] args) {
          long numMillisecondsToSleep = 60000; 
          new ClassPathXmlApplicationContext("client-context.xml");  
  
          while (true) {
              try {
                  logger.info("Sleeping for 60 seconds");
                  Thread.sleep(numMillisecondsToSleep);
              } catch (InterruptedException e) {
                  e.printStackTrace();
              }
          }
      }
  </code></pre>
  
  <p>I was wondering if anyone might know why I'm getting this exception.  I'm very new to ActiveMQ and JMS in general so any ideas would be greatly appreciated.</p>