title: jQuery ajax call not falling into success
body: <p>I am new to doing jQuery ajax calls and am trying to test an ajax call I have attempted to write today. Here it is.</p>
  
  <pre><code>var heartbeatInterval = 30000;
  var heartBeatTimer = null;
  var retryCount = 0;
  var maxRetries = 10;
  
  $().ready(function () {
  
      var url = $.url("/pollBulletin.htm");
      heartBeatTimer = setInterval(function () {
          $.ajax({
              url: url,
              type: 'GET',
              error: function (data) {
  
                  retryCount = retryCount + 1;
                  if (heartBeatTimer != null &amp;&amp; retryCount &gt;= maxRetries) {
                      clearInterval(heartBeatTimer);
                  }
              },
              success: function (bulletinBarMessage) {
  
                  retryCount = 0;
                  var respContent = "";
                  respContent += bulletinBarMessage.messageLevel + " : ";
                  respContent += bulletinBarMessage.message;
              }
          });
          // When communication with the server is lost stop the heartbeat.
      }, heartbeatInterval);
  });
  </code></pre>
  
  <p>At the moment the code is never falling into the success part of the call. Can someone confirm if it looks ok? I'm not sure if I have coded this right. I know the server side code is doing the write thing. At the moment it is just return a null (server side).</p>
  
  <p>Server side...</p>
  
  <pre><code>public BulletinBarMessage getBulletinBarMessage() {
      JdbcTemplate select = this.getJdbcTemplate();
      List&lt;BulletinBarMessage&gt; messages = select.query(BULLETIN_LOOKUP_SQL, new BulletinBarMessageRowMapper());
      BulletinBarMessage bulletinBarMessage = null;
  
      if (messages != null &amp;&amp; !messages.isEmpty()){
          bulletinBarMessage = (BulletinBarMessage)messages.get(0);
      }
  
      return bulletinBarMessage;
  }
  </code></pre>